mirror of
https://github.com/jquery/jquery.git
synced 2025-01-10 18:24:24 +00:00
Fix #14432: Always return string from .css("z-index"). Close gh-1395.
This commit is contained in:
parent
b24a3d5368
commit
5ce4b06c28
@ -44,7 +44,9 @@ function curCSS( elem, name, computed ) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return ret;
|
// Support: IE
|
||||||
|
// IE returns zIndex value as an integer.
|
||||||
|
return ret === undefined ? ret : ret + "";
|
||||||
}
|
}
|
||||||
|
|
||||||
return curCSS;
|
return curCSS;
|
||||||
|
@ -197,6 +197,16 @@ test( "css() explicit and relative values", 29, function() {
|
|||||||
equal( $elem.css("opacity"), "1", "'+=0.5' on opacity (params)" );
|
equal( $elem.css("opacity"), "1", "'+=0.5' on opacity (params)" );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("css(String) where values are z-index", function() {
|
||||||
|
expect(1);
|
||||||
|
|
||||||
|
var $elem = jQuery( "<div>" ).appendTo( "#qunit-fixture" );
|
||||||
|
|
||||||
|
$elem.css({ "position": "absolute", "z-index": "1000" });
|
||||||
|
strictEqual( $elem.css( "z-index" ), "1000" );
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
test("css(String, Object)", function() {
|
test("css(String, Object)", function() {
|
||||||
expect( 19 );
|
expect( 19 );
|
||||||
var j, div, display, ret, success;
|
var j, div, display, ret, success;
|
||||||
@ -353,6 +363,14 @@ test("css(Object) where values are Functions", function() {
|
|||||||
jQuery("#cssFunctionTest").remove();
|
jQuery("#cssFunctionTest").remove();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("css(String) where values are undefined", function() {
|
||||||
|
expect(1);
|
||||||
|
|
||||||
|
var $elem = jQuery( "#nothiddendiv" );
|
||||||
|
|
||||||
|
strictEqual( $elem.css( "test" ), undefined );
|
||||||
|
});
|
||||||
|
|
||||||
test("css(Object) where values are Functions with incoming values", function() {
|
test("css(Object) where values are Functions with incoming values", function() {
|
||||||
expect(3);
|
expect(3);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user