Skip to main content

Bug Tracker

Side navigation

#803 closed bug (fixed)

Opened January 15, 2007 10:14AM UTC

Closed January 17, 2007 01:34PM UTC

Last modified June 19, 2007 09:26AM UTC

setting opacity is not working

Reported by: Stefan Owned by:
Priority: major Milestone: 1.1
Component: core Version: 1.1
Keywords: Cc:
Blocked by: Blocking:

$(el).css('opacity', 0.5); is not working in version 1.1

Attachments (0)
Change History (3)

Changed January 15, 2007 02:55PM UTC by joern comment:1

This must be due to the auto-convert to pixel values with any number values passed to css. The same applies to css("z-index", 100), which must currently be written as css("z-index", "100").

What is uglier? Appending "px" for pixel values or converting non-pixel numbers to Strings explicitly?

Changed January 16, 2007 03:35PM UTC by brandon comment:2

jQuery.prop is responsible. We will need to filter out non valued property numbers but jQuery.prop doesn't currently provide us with a way to know what property is being converted. This seems very hackish. Here are a few properties we will need to filter out:

  • z-index/zIndex
  • opacity
  • zoom

I can't think of any other number valued CSS properties.

Changed January 17, 2007 01:34PM UTC by joern comment:3

resolution: → fixed
status: newclosed

jQuery.prop now handles these special cases. It may be a bit hackish, but makes the css methods very convienent to use, no more + "px" stuff everywhere.