Bug Tracker

Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#824 closed bug (duplicate)

jQuery.fn.css(hash) couldn't set 'z-index ' style property

Reported by: art.orlov@… 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"
    });

Change History (1)

comment:1 Changed 13 years ago by joern

Resolution: duplicate
Status: newclosed

See #812

Note: See TracTickets for help on using tickets.