Side navigation
#824 closed bug (duplicate)
Opened January 16, 2007 01:31PM UTC
Closed January 16, 2007 01:41PM UTC
Last modified June 19, 2007 09:23AM UTC
jQuery.fn.css(hash) couldn't set 'z-index ' style property
Reported by: | art.orlov@gmail.com | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.1 |
Component: | core | Version: | 1.1 |
Keywords: | css, z-index | Cc: | |
Blocked by: | Blocking: |
Description
I'm trying to set properties of jQueried object like this:
self.css({ position: "absolute", left: 100, top: 200, zIndex: 300 });
With 1.1 release I can pass left/top/etc property values without "px" added at the end of value. Thanks. But a couldn't set z-index value, due to code of jQuery.prop method:
prop: function(elem, value, type){ // Handle executable functions if ( jQuery.isFunction( value ) ) return value.call( elem ); // Handle passing in a number to a CSS property if ( value.constructor == Number && type == "curCSS" ) return value + "px"; return value; },
It converts all numbers passed as values to strings ended with "px".
The only workaround is to pass string as number value like this:
self.css({ position: "absolute", left: 100, top: 200, zIndex: "300" });
Attachments (0)
Change History (1)
Changed January 16, 2007 01:41PM UTC by comment:1
resolution: | → duplicate |
---|---|
status: | new → closed |
See #812