Skip to main content

Bug Tracker

Side navigation

#7274 closed bug (worksforme)

Opened October 21, 2010 08:59PM UTC

Closed October 21, 2010 09:27PM UTC

dashes don't work when used in css() objects

Reported by: marc.fuehnen@gmail.com Owned by:
Priority: low Milestone: 1.5
Component: unfiled Version: 1.4.3
Keywords: dashes css Cc:
Blocked by: Blocking:
Description

hi e1,

if you want to change css values using an object as parameter like:

$( "#sample" ).css( {'width': a + 'px'} );

it does not work anymore if you use css properties that start with a dash/hyphen (-), jq ignores the obj key, e.x. transformation

$( "#sample" ).css( {'-moz-transform': 'rotate(' + a + 'deg)'} );

it works if you do it the single-property way:

$( "#sample" ).css( '-moz-transform', 'rotate(' + a + 'deg)' );

tested on windows 7, latest FF, webkit

everything was ok in 1.4.2

Attachments (0)
Change History (1)

Changed October 21, 2010 09:27PM UTC by addyosmani comment:1

_comment0: Testing with FireFox latest:[[BR]] \ 1. Your first test working fine [http://jsfiddle.net/W5GSY/][[BR]] \ 2. Your second test working fine [http://jsfiddle.net/W5GSY/1/][[BR]] \ 3. Your third test working fine [http://jsfiddle.net/W5GSY/2/][[BR]] \ [[BR]] \ \ These are all functioning equally as well.[[BR]]Note that if you're testing - properties across browsers you will obviously have to switch -moz and -webkit, but otherwise these are working perfectly for me. \ 1287696486075498
keywords: → dashes css
priority: undecidedlow
resolution: → worksforme
status: newclosed

Testing with FireFox latest:

1. Your first test working fine http://jsfiddle.net/W5GSY/

2. Your second test working fine http://jsfiddle.net/W5GSY/1/

3. Your third test working fine http://jsfiddle.net/W5GSY/2/

(also tested with Chrome, Safari using the -webkit version of those attribs)

These are all functioning equally as well.Note that if you're testing - properties across browsers you will obviously have to switch -moz and -webkit, but otherwise these are working perfectly for me.