diff --git a/src/css/curCSS.js b/src/css/curCSS.js index e09574530..1af1812cd 100644 --- a/src/css/curCSS.js +++ b/src/css/curCSS.js @@ -51,7 +51,9 @@ if ( window.getComputedStyle ) { } } - return ret; + // Support: IE + // IE returns zIndex value as an integer. + return ret === undefined ? ret : ret + ""; }; } else if ( document.documentElement.currentStyle ) { getStyles = function( elem ) { @@ -99,7 +101,11 @@ if ( window.getComputedStyle ) { } } - return ret === "" ? "auto" : ret; + return ret === "" ? "auto" : + // Support: IE + // IE returns zIndex value as an integer. + ret === undefined ? ret : + ret + ""; }; } diff --git a/test/unit/css.js b/test/unit/css.js index e6f9c91df..56d22bdf2 100644 --- a/test/unit/css.js +++ b/test/unit/css.js @@ -200,6 +200,16 @@ test( "css() explicit and relative values", 29, function() { equal( $elem.css("opacity"), "1", "'+=0.5' on opacity (params)" ); }); +test("css(String) where values are z-index", function() { + expect(1); + + var $elem = jQuery( "