Bug Tracker

Modify

Ticket #7274 (closed bug: worksforme)

Opened 3 years ago

Last modified 3 years ago

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

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

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

Change History

comment:1 Changed 3 years ago by addyosmani

  • Keywords dashes css added
  • Priority changed from undecided to low
  • Status changed from new to closed
  • Resolution set to worksforme

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/


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.

Version 0, edited 3 years ago by addyosmani (next)

Please follow the  bug reporting guidlines and use  jsFiddle when providing test cases and demonstrations instead of pasting the code in the ticket.

View

Add a comment

Modify Ticket

Action
as closed
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.