Bug Tracker

Opened 7 years ago

Closed 6 years ago

Last modified 6 years ago

#7345 closed enhancement (fixed)

Support relative values for $().css()

Reported by: brandon Owned by: danheberden
Priority: low Milestone: 1.6
Component: css Version: 1.4.3
Keywords: relative css Cc:
Blocked by: Blocking:

Description

Pulled from: http://github.com/paulirish/lazyweb-requests/issues/issue/10

Relative values are usable in jQuery.fn.animate, why not jQuery.fn.css? Help me stop using this work around:

$('elem').animate({ 'left' : '+=10px' }, 0);

Attachments (1)

7345.patch (1.9 KB) - added by brandon 7 years ago.
Patch + tests

Download all attachments as: .zip

Change History (14)

comment:1 Changed 7 years ago by brandon

Component: unfiledcss
Priority: undecidedlow

Changed 7 years ago by brandon

Attachment: 7345.patch added

Patch + tests

comment:2 Changed 7 years ago by brandon

Added patch to github with pull request: http://github.com/jquery/jquery/pull/78

comment:3 Changed 7 years ago by SlexAxton

Keywords: relative css added
Priority: lowhigh
Status: newopen

As far as enhancements go, I think this is a great one. Thanks for the pull request.

comment:4 Changed 7 years ago by dmethvin

Priority: highlow

comment:5 Changed 7 years ago by snover

Owner: set to brandon
Status: openassigned

comment:6 Changed 7 years ago by paul.irish

I keep thinking this is already in. snov, can you land this?

comment:7 Changed 7 years ago by paul.irish

snover is interested in seeing this patch done a bit more DRY. have to generalize the effect.js aspect of this to share between the two. https://github.com/jquery/jquery/pull/78

anyone can feel free to tackle that. :)

comment:8 Changed 7 years ago by ajpiano

Owner: changed from brandon to ajpiano

comment:9 Changed 7 years ago by ajpiano

Milestone: 1.6

comment:10 Changed 6 years ago by ajpiano

Owner: changed from ajpiano to danheberden

comment:11 Changed 6 years ago by dmethvin

Resolution: fixed
Status: assignedclosed

comment:12 Changed 6 years ago by anonymous

not working here in 1.6.1 ...

comment:13 Changed 6 years ago by danheberden

Sorry you're having troubles - sounds like something else might be the problem though? Please provide a test case for the odd behaviour you're experiencing using jsfiddle.net

I made one: http://jsfiddle.net/danheberden/tGNZm/

Since jsfiddle.net doesn't have 1.6.1 on the list, I just added it via the resources area: https://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js

Note: See TracTickets for help on using tickets.