Skip to main content

Bug Tracker

Side navigation

#8685 closed enhancement (fixed)

Opened March 28, 2011 08:26PM UTC

Closed November 08, 2012 01:25AM UTC

Last modified November 08, 2012 01:25AM UTC

Animations should keep track of animation state in order to properly address stacked animations

Reported by: ajpiano Owned by: gnarf
Priority: blocker Milestone: 1.8.3
Component: effects Version: 1.5.1
Keywords: 1.7-discuss Cc:
Blocked by: Blocking:
Description

None of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way:

http://jsfiddle.net/ajpiano/gqZL5/10/

http://jsfiddle.net/rpflorence/gqZL5/

In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally.

http://jsfiddle.net/rpflorence/gqZL5/1/

We should support this common usecase more gracefully

Attachments (0)
Change History (26)

Changed March 28, 2011 08:27PM UTC by ajpiano comment:1

component: unfiledeffects
milestone: 1.next1.7
owner: → john
priority: undecidedhigh
status: newassigned

Changed March 30, 2011 08:04PM UTC by ajpiano comment:2

_comment0: See also 24081302385449264444

See also #2408

Changed April 09, 2011 06:15PM UTC by timmywil comment:3

#8830 is a duplicate of this ticket.

Changed April 16, 2011 11:50PM UTC by john comment:4

#2408 is a duplicate of this ticket.

Changed April 16, 2011 11:50PM UTC by john comment:5

milestone: 1.71.next
owner: john

Let's get this on the roadmap for 1.7.

Changed May 22, 2011 07:27PM UTC by john comment:6

keywords: → 1.7-discuss

Nominating ticket for 1.7 discussion.

Changed May 23, 2011 12:35AM UTC by jaubourg comment:7

description: None of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way: \ \ http://jsfiddle.net/ajpiano/gqZL5/10/ \ http://jsfiddle.net/rpflorence/gqZL5/ \ \ In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally. \ \ http://jsfiddle.net/rpflorence/gqZL5/1/ \ \ We should support this common usecase more gracefullyNone of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way:\ \ http://jsfiddle.net/ajpiano/gqZL5/10/\ http://jsfiddle.net/rpflorence/gqZL5/\ \ In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally.\ \ http://jsfiddle.net/rpflorence/gqZL5/1/\ \ We should support this common usecase more gracefully

+1,

Changed May 23, 2011 04:22AM UTC by timmywil comment:8

+1, +1 +1 +1 +1 +1

Changed May 24, 2011 09:22PM UTC by dmethvin comment:9

description: None of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way:\ \ http://jsfiddle.net/ajpiano/gqZL5/10/\ http://jsfiddle.net/rpflorence/gqZL5/\ \ In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally.\ \ http://jsfiddle.net/rpflorence/gqZL5/1/\ \ We should support this common usecase more gracefullyNone of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way: \ \ http://jsfiddle.net/ajpiano/gqZL5/10/ \ http://jsfiddle.net/rpflorence/gqZL5/ \ \ In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally. \ \ http://jsfiddle.net/rpflorence/gqZL5/1/ \ \ We should support this common usecase more gracefully

+1, Is someone volunteering?

Changed May 28, 2011 04:40PM UTC by timmywil comment:10

owner: → timmywil

Changed May 30, 2011 05:34AM UTC by timmywil comment:11

Changed May 30, 2011 05:35AM UTC by timmywil comment:12

milestone: 1.next1.7

Changed June 03, 2011 01:51PM UTC by john comment:13

description: None of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way: \ \ http://jsfiddle.net/ajpiano/gqZL5/10/ \ http://jsfiddle.net/rpflorence/gqZL5/ \ \ In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally. \ \ http://jsfiddle.net/rpflorence/gqZL5/1/ \ \ We should support this common usecase more gracefullyNone of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way:\ \ http://jsfiddle.net/ajpiano/gqZL5/10/\ http://jsfiddle.net/rpflorence/gqZL5/\ \ In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally.\ \ http://jsfiddle.net/rpflorence/gqZL5/1/\ \ We should support this common usecase more gracefully

+1, Sounds cool - let's go for it!

Changed June 03, 2011 03:55PM UTC by scottgonzalez comment:14

+1, this is really interesting, but I assume it only works when using the same animation for both directions?

Changed June 05, 2011 01:33PM UTC by rpflorence comment:15

MooTools has a "link" option when animations are stacked. There's "ignore", "cancel", and "chain".

Ignore - ignores any calls while animating

Cancel - Cancels the current animation, starts the next one from the current state (what you're seeing in the original fiddle I created for ajpiano)

Chain - Stack the next effect. The default jQuery behavior (rarely what you want).

This option is obviously really helpful. I've been working on porting the MooTools Fx constructor to power the jQuery effects mostly for this option (and I find them a little smoother in some browsers).

Changed June 05, 2011 01:37PM UTC by rpflorence comment:16

_comment0: @timmywil - I'm not entirely familiar with the underlying jQuery.fx, but wouldn't it be better to do the state tracking there so it just works™ with all animations? (rather than changing a lot of code in the shortcuts like `show` and `slideToggle`1307281309850667

@timmywil - I'm not entirely familiar with the underlying jQuery.fx, but wouldn't it be better to do the state tracking there so it just works™ with all animations? (rather than changing a lot of code in the shortcuts like show and slideToggle)

Regardless, VERY happy to see this progress on your 1.7 branch. I'm using jQuery for most of my work these days and battling this has ladened my transition to jQuery with frustration :)

Changed June 05, 2011 05:40PM UTC by timmywil comment:17

description: None of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way:\ \ http://jsfiddle.net/ajpiano/gqZL5/10/\ http://jsfiddle.net/rpflorence/gqZL5/\ \ In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally.\ \ http://jsfiddle.net/rpflorence/gqZL5/1/\ \ We should support this common usecase more gracefullyNone of the various combinations of utilising .stop() gracefully handle many quick animation triggers in a desirable way: \ \ http://jsfiddle.net/ajpiano/gqZL5/10/ \ http://jsfiddle.net/rpflorence/gqZL5/ \ \ In MooTools, this is handled in a much more intuitive way, because it tracks the animation state internally. \ \ http://jsfiddle.net/rpflorence/gqZL5/1/ \ \ We should support this common usecase more gracefully

@rpflorence: jQuery fx has a different structure than Mootools, a structure I don't think we want to change. The options mentioned can be replicated in different ways in jQuery. Ignore might be similar to setting queue to false, chain as you said is the behavior of the jQuery queue (which has its own advantages I think), and cancel...well that wasn't really an option before unless you created your own animation that kept track of state. Finally, I think you're confused about what I've written. The code I've added and updated will work for all animations. The show function you see updated is not jQuery.fn.show, it's the show on the jQuery.fx prototype. Any property set to "show" or "toggle" will use this function and that is what we're talking about. Animations set to actual values are unaffected because we don't have to do any calculations for the user. Like I said before, you could already do before what is done in MooTools with a custom jQuery animation that sets values and keeps track of its own state. This will add that state tracking so that actual values do not need to be passed. I think what you're asking for in your last comment is really what I've already done. Anyway, I agree. This is something I've wanted jQuery to do since I first started using it as well.

Changed June 05, 2011 09:25PM UTC by ajpiano comment:18

+1, Obvs - also it seems like timmy's solution seems to cover the intended problem in the right spot...

Changed August 12, 2011 03:48PM UTC by timmywil comment:19

#10015 is a duplicate of this ticket.

Changed September 19, 2011 07:43PM UTC by timmywil comment:20

resolution: → fixed
status: assignedclosed

Animation state is tracked on toggled/stopped animations using the private data cache. Fixes #8685. See full commit message for more. Fixes #6641.

  • Check the completed timer has not been removed already so other timers do not get accidentally removed. Fixes #6641.
  • Style edits, code reductions, and optimizations for the effects module

Changeset: 1878885fb7a09b65d95980a9b7dce2df2944e4f9

Changed October 07, 2011 12:44AM UTC by dmethvin comment:21

#10263 is a duplicate of this ticket.

Changed November 04, 2012 07:06AM UTC by gnarf comment:22

milestone: 1.71.8.3
priority: highblocker
resolution: fixed
status: closedreopened

We had a regression on this in 1.8.0 - I'm going to make sure to cover this in the units.

http://jsfiddle.net/cz4XM/1/

Changed November 05, 2012 04:07PM UTC by david71rj comment:23

Seems that @timmywil fix works fine with @gnarf fiddle here. And it solve a big problem, really.

Changed November 06, 2012 02:58PM UTC by timmywil comment:24

owner: timmywilgnarf
status: reopenedassigned

Changed November 08, 2012 01:25AM UTC by Corey Frang comment:25

resolution: → fixed
status: assignedclosed

Keep track of a hiding state for toggle based animations - Fixes #8685

Closes gh-1018

Changeset: c45f6095f2d58a9fefd6bc788e50140acc7cf0c4

Changed November 08, 2012 01:25AM UTC by Corey Frang comment:26

Keep track of a hiding state for toggle based animations - Fixes #8685

Closes gh-1018

(cherry picked from commit c45f6095f2d58a9fefd6bc788e50140acc7cf0c4)

Conflicts:

src/effects.js

Changeset: bee4d0307216292bb0e69b7431d054cf86bdfc43