Skip to main content

Bug Tracker

Side navigation

#12273 closed bug (fixed)

Opened August 12, 2012 11:33PM UTC

Closed August 20, 2012 02:13AM UTC

animate fails with 0 duration

Reported by: jarkaruus Owned by: gnarf
Priority: high Milestone: 1.8.1
Component: effects Version: 1.8.0
Keywords: Cc:
Blocked by: Blocking:

Switching from 1.7.2 to 1.8 some plugins using animate with a duration of 0 don't animate at all in certain situations.

$(element).animate({ left: '-400px' }, 0, function() {}); // broken since 1.8
$(element).animate({ left: '-400px' }, 1, function() {}); // works

My guess is that a type check was changed into something else.

Attachments (0)
Change History (14)

Changed August 13, 2012 12:52AM UTC by addyosmani comment:1

component: unfiledeffects
owner: → jarkaruus
priority: undecidedlow
status: newpending

Thanks for submitting a ticket to the jQuery bug tracker. Could you reply back with a test case on reproducing the issue? If you could also test against jQuery-Git to ensure this hasn't been fixed by the latest version that would be appreciated.

Changed August 13, 2012 08:54AM UTC by jarkaruus comment:2

status: pendingnew

Here is the fiddle:

The problem is there when having both jQuery UI 1.8.22 and jQuery 1.8 on the page.

Changed August 13, 2012 09:07AM UTC by scottgonzalez comment:3

Hmm...this works against jQuery UI master, so it's probably a bug in UI. I'll dig into this today and find out which bug tracker this belongs in.

Changed August 13, 2012 09:41AM UTC by scottgonzalez comment:4

What's happening is jQuery 1.8 now performs a single tick animation, while 1.7.2 skipped the animation. Was that an intentional change? This breaks in old jQuery UI because the easing equations that everybody uses (including jQuery UI) rely on duration. jQuery UI master works because we rewrote all easing equations to only rely on state. So this is a breaking change. We can fix it in jQuery UI 1.8.23, but anyone using the easing plugin on its own will have broken animations for a duration of 0.

Changed August 13, 2012 09:48AM UTC by scottgonzalez comment:5

This is now fixed in jQuery UI 1-8-stable and will be included in 1.8.23 this week. See

Changed August 13, 2012 09:53AM UTC by jarkaruus <> comment:6

Awesome, thanks

Changed August 13, 2012 12:45PM UTC by jarkaruus comment:7

Now that the extra easing equations have been reduced to a few lines of code maybe it makes sense to move them into jQuery so all of them are in one place?

Changed August 14, 2012 11:57AM UTC by sindresorhus comment:8

resolution: → fixed
status: newclosed

Changed August 14, 2012 12:21PM UTC by scottgonzalez comment:9

_comment0: @indersorhus I didn't see any commits for this, how did it get fixed?1344946925342005

@sindresorhus I didn't see any commits for this, how did it get fixed?

Changed August 14, 2012 09:50PM UTC by gnarf comment:10

milestone: None1.8.1
priority: lowhigh
resolution: fixed
status: closedreopened

Changed August 14, 2012 09:50PM UTC by gnarf comment:11

The issue here is passing a 0 duration to an easing function, if the duration is 0 it probably should skip easing altogether.

Changed August 14, 2012 09:50PM UTC by gnarf comment:12

owner: jarkaruusgnarf
status: reopenedassigned

Changed August 15, 2012 09:17PM UTC by gnarf comment:13

Changed August 20, 2012 02:13AM UTC by Corey Frang comment:14

resolution: → fixed
status: assignedclosed

Fix #12273. Don't call easing functions for duration 0 animations. Close gh-895.

Changeset: 0fea007a1a4d6456a8c7d246e4f7a4e14a1ba04a