Skip to main content

Bug Tracker

Side navigation

#7345 closed enhancement (fixed)

Opened October 28, 2010 07:05PM UTC

Closed April 06, 2011 02:45AM UTC

Last modified May 17, 2011 08:56PM UTC

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 October 28, 2010 07:07PM UTC.

    Patch + tests

Change History (13)

Changed October 28, 2010 07:06PM UTC by brandon comment:1

component: unfiledcss
priority: undecidedlow

Changed October 28, 2010 09:28PM UTC by brandon comment:2

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

Changed October 29, 2010 04:34AM UTC by SlexAxton comment:3

keywords: → relative css
priority: lowhigh
status: newopen

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

Changed November 21, 2010 02:16AM UTC by dmethvin comment:4

priority: highlow

Changed November 21, 2010 10:45PM UTC by snover comment:5

owner: → brandon
status: openassigned

Changed December 17, 2010 08:25PM UTC by paul.irish comment:6

I keep thinking this is already in.

snov, can you land this?

Changed December 20, 2010 12:06AM UTC by paul.irish comment:7

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. :)

Changed March 14, 2011 05:00PM UTC by ajpiano comment:8

owner: brandonajpiano

Changed March 14, 2011 08:16PM UTC by ajpiano comment:9

milestone: → 1.6

Changed April 04, 2011 04:44PM UTC by ajpiano comment:10

owner: ajpianodanheberden

Changed April 06, 2011 02:45AM UTC by dmethvin comment:11

resolution: → fixed
status: assignedclosed

Changed May 17, 2011 08:19PM UTC by anonymous comment:12

not working here in 1.6.1 ...

Changed May 17, 2011 08:56PM UTC by danheberden comment:13

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