Skip to main content

Bug Tracker

Side navigation

#7193 closed bug (fixed)

Opened October 14, 2010 10:40PM UTC

Closed December 30, 2010 07:23AM UTC

Last modified March 09, 2012 06:14PM UTC

$.fn.animate cannot "start" from any value less than -10000

Reported by: tdreyno@gmail.com 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?

Attachments (0)
Change History (28)

Changed October 14, 2010 10:55PM UTC by tdreyno@gmail.com comment:1

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/

Changed October 14, 2010 11:56PM UTC by snover comment:2

cc: → john
component: unfiledeffects
milestone: 1.4.31.next
priority: undecidedlow
status: newopen

Good question.

Changed October 15, 2010 12:03AM UTC by jitter comment:3

_comment0: This isn't much of a help but might server as a starting point. \ \ The limit was introduced in August 2006 [http://github.com/jquery/jquery/commit/7caca06cfc28fab22ec9c3a2d1363fec8d8c1951 Relevant Commit] to apparently fix something in Opera (at that time Opera 9.00-9.02 where the most current versions)1287102534411773
_comment1: This isn't much of a help but might serve as a starting point. \ \ The limit was introduced in August 2006 [http://github.com/jquery/jquery/commit/7caca06cfc28fab22ec9c3a2d1363fec8d8c1951 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/21287102617472660

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)

Changed October 21, 2010 10:57PM UTC by snover comment:4

milestone: 1.4.41.4.5

Retargeting due to severity of regressions in 1.4.3.

Changed October 22, 2010 07:44PM UTC by dmethvin comment:5

#7287 is a duplicate of this ticket.

Changed October 23, 2010 09:23PM UTC by john comment:6

milestone: 1.4.51.4.4
owner: → john
status: openassigned

Changed October 28, 2010 02:09AM UTC by snover comment:7

milestone: 1.4.41.4.5

Retargeting to next minor release.

Changed November 04, 2010 09:49PM UTC by rwaldron comment:8

#7403 is a duplicate of this ticket.

Changed November 09, 2010 07:34PM UTC by addyosmani comment:9

#7450 is a duplicate of this ticket.

Changed November 12, 2010 10:58AM UTC by lazahu@gmail.com comment:10

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.

Changed November 12, 2010 11:01AM UTC by anonymous comment:11

Sorry, I'm totally dumb, haven't noticed it's been found already. You can remove my comments.

Changed November 16, 2010 07:54PM UTC by jitter comment:12

#7532 is a duplicate of this ticket.

Changed November 19, 2010 10:23AM UTC by lazahu@gmail.com comment:13

Just another test case to fiddle with: http://jsfiddle.net/mwJkJ/

Changed November 21, 2010 10:12PM UTC by snover comment:14

3rd party pull request

Changed November 22, 2010 10:47PM UTC by anonymous comment:15

I've implemented

return r /*&& r > -10000 ? r : 0*/;

and look forward to a fix in a future release

Changed November 24, 2010 05:52PM UTC by rwaldron comment:16

#7625 is a duplicate of this ticket.

Changed November 29, 2010 09:16AM UTC by daniel.baulig@gmx.de comment:17

Replying to [comment:10 lazahu@…]:

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.

Changed November 30, 2010 10:48AM UTC by jitter comment:18

#7657 is a duplicate of this ticket.

Changed December 13, 2010 06:45PM UTC by jitter comment:19

#7760 is a duplicate of this ticket.

Changed December 17, 2010 03:04PM UTC by jitter comment:20

#7801 is a duplicate of this ticket.

Changed December 29, 2010 12:27PM UTC by anonymous comment:21

Great, got it fixed as daniel.baulig and lazahu suggested, thanks. It kept me up whole night yesterday

Changed December 29, 2010 01:45PM UTC by anonymous comment:22

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!

Changed December 29, 2010 02:24PM UTC by dmethvin comment:23

#7859 is a duplicate of this ticket.

Changed December 29, 2010 04:11PM UTC by ajpiano comment:24

_comment0: 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. \ \ 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.1293639161304299
_comment1: 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. \ \ 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. :)1293639397870228

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

Changed December 30, 2010 07:23AM UTC by Colin Snover comment:25

resolution: → fixed
status: assignedclosed

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

Changed January 10, 2011 01:11PM UTC by jitter comment:26

milestone: 1.4.51.5

Changed January 10, 2011 01:16PM UTC by jitter comment:27

#7935 is a duplicate of this ticket.

Changed February 21, 2011 05:57PM UTC by jitter comment:28

#8341 is a duplicate of this ticket.