Bug Tracker

Opened 16 years ago

Closed 16 years ago

Last modified 16 years ago

#803 closed bug (fixed)

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

Change History (3)

comment:1 Changed 16 years ago by joern

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?

comment:2 Changed 16 years ago by brandon

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.

comment:3 Changed 16 years ago by joern

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.

Note: See TracTickets for help on using tickets.