Bug Tracker

Opened 6 years ago

Closed 5 years ago

Last modified 5 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);

Change History (13)

comment:1 Changed 6 years ago by brandon

  • Component changed from unfiled to css
  • Priority changed from undecided to low

comment:2 Changed 6 years ago by brandon

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

comment:3 Changed 6 years ago by SlexAxton

  • Keywords relative css added
  • Priority changed from low to high
  • Status changed from new to open

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

comment:4 Changed 6 years ago by dmethvin

  • Priority changed from high to low

comment:5 Changed 6 years ago by snover

  • Owner set to brandon
  • Status changed from open to assigned

comment:6 Changed 6 years ago by paul.irish

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

comment:7 Changed 6 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 5 years ago by ajpiano

  • Owner changed from brandon to ajpiano

comment:9 Changed 5 years ago by ajpiano

  • Milestone set to 1.6

comment:10 Changed 5 years ago by ajpiano

  • Owner changed from ajpiano to danheberden

comment:11 Changed 5 years ago by dmethvin

  • Resolution set to fixed
  • Status changed from assigned to closed

comment:12 Changed 5 years ago by anonymous

not working here in 1.6.1 ...

comment:13 Changed 5 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.