#7193 closed bug (fixed)
$.fn.animate cannot "start" from any value less than -10000
Reported by: | Owned by: | john | |
---|---|---|---|
Priority: | low | Milestone: | 1.5 |
Component: | effects | Version: | 1.4.3 |
Keywords: | Cc: | john | |
Blocked by: | Blocking: |
Description
On line 6347: return r && r > -10000 ? r : 0;
Essentially, the default start value of an animation can be as low as -10000, otherwise it resets to 0.
I'm using a very long scrollable area (about 15000px), when I slide from -9000px to near the end (say -14000px) it resets to 0 and animated from 0->-14000px, rather than -9000px->-14000px.
Is there a reason for this arbitrary limit?
Change History (28)
comment:1 Changed 12 years ago by
comment:2 Changed 12 years ago by
Cc: | john added |
---|---|
Component: | unfiled → effects |
Milestone: | 1.4.3 → 1.next |
Priority: | undecided → low |
Status: | new → open |
Good question.
comment:3 Changed 12 years ago by
This isn't much of a help but might serve as a starting point.
The limit was introduced in August 2006 Relevant Commit to apparently fix something in Opera (at that time approx. Opera 9.00 was the current version)
For me your test-case doesn't fail but thats because jQuery 1.4.2 is used.
Here I provide the same test-case again but this time with jQuery 1.4.3rc2 used and the animation fails
http://jsbin.com/ewulu/3 (source view: http://jsbin.com/ewulu/3/edit)
comment:4 Changed 12 years ago by
Milestone: | 1.4.4 → 1.4.5 |
---|
Retargeting due to severity of regressions in 1.4.3.
comment:6 Changed 12 years ago by
Milestone: | 1.4.5 → 1.4.4 |
---|---|
Owner: | set to john |
Status: | open → assigned |
comment:10 follow-up: 17 Changed 12 years ago by
Here's a heuristic fix for the bug.
Change line 6624 from:
return r && r > -10000 ? r : 0;
to:
return r;
Tested for this particular problem in FF 3.6.12, Chrome 7.0.517.44, IE 8.0.7600.16385, Safari 5.0.2 and Opera 10.63.3516. Works like expected.
comment:11 Changed 12 years ago by
Sorry, I'm totally dumb, haven't noticed it's been found already. You can remove my comments.
comment:13 Changed 12 years ago by
Just another test case to fiddle with: http://jsfiddle.net/mwJkJ/
comment:15 Changed 12 years ago by
I've implemented
return r /*&& r > -10000 ? r : 0*/;
and look forward to a fix in a future release
comment:17 Changed 12 years ago by
Replying to [email protected]…:
Change line 6624 from:
return r && r > -10000 ? r : 0;to:
return r;Tested for this particular problem in FF 3.6.12, Chrome 7.0.517.44, IE 8.0.7600.16385, Safari 5.0.2 and Opera 10.63.3516. Works like expected.
I suggest reducing the amount of changed code by only removing the cause of the problem and not the additional validity check by using the following code:
return r ? r : 0;
or
return r || 0;
The check if r is true-ish is in no way related to this bug and should be kept in place in case it breaks something else.
comment:21 Changed 12 years ago by
Great, got it fixed as daniel.baulig and lazahu suggested, thanks. It kept me up whole night yesterday
comment:22 Changed 12 years ago by
Hacking the core as described unfortunately is no solution for distributed packages.
This bug doesn't even show up in the change log for jQuery 1.5, does that mean it hasn't been fixed (yet?) in the future version? Some details from one of the developers would be greatly appreciated!
comment:24 Changed 12 years ago by
To which jQuery 1.5 changelog do you refer? There is not an official jQuery 1.5 changelog yet, because there is no jQuery 1.5 yet. If you're referring to the changelog in the recent community updates post, that is just a log of changes that have happened thus far, it is not a complete changelog.
When the bug is fixed, this ticket will be closed. It is certainly something we are planning to address for 1.5 - otherwise we'll be getting dupes on this issue until the end of time. :)
comment:25 Changed 12 years ago by
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Remove patch for very early versions of Opera 9 that made it impossible to animate values smaller than -10000. Fixes #7193. Thanks to igorw for initial patch & test case.
Changeset: 4eeae8b0bc789ad525e98568cffb37b04b27ae84
comment:26 Changed 12 years ago by
Milestone: | 1.4.5 → 1.5 |
---|
JSfiddle example... but jsfiddle doesn't have 1.4.3rc
Basically, you should never see red again after is scrolls offscreen the first time:
http://jsfiddle.net/uMeHf/1/