This project is archived and is in readonly mode.

#713 ✓invalid

Fx.cancel() should clear animation so Fx.resume() will not continue it

Reported by Jaik | July 21st, 2009 @ 05:16 PM | in 2.0 (closed)

When Fx.resume() is called after Fx.cancel(), the animation is resumed as if it were paused, rather than cancelled.

Really simple test case:

$('test').set('tween', {duration: 2000}).tween('width', 100);

The animation should be cancelled almost immediately, but in fact it continues and finishes.

Comments and changes to this ticket

  • Scott Kyle

    Scott Kyle July 21st, 2009 @ 07:37 PM

    • Tag changed from 1.2.3 to 1.2.3

    Cancel isn't intended to return the element to its starting position. It pauses the animation, clears the chained Fx, and fires the "cancel" event. It should be up to the developer to return the element where it belongs on the "cancel" event if desired. There shouldn't be a reason to call resume() after cancel().

  • Jaik

    Jaik July 22nd, 2009 @ 09:02 AM

    Correct, the element shouldn't be returned to its starting position. What I mean is that the animation starts, then is stopped via Fx.cancel(), which is all well and good. Then if Fx.resume() is called after, the animation actually continues and completes itself.

    Surely Fx.cancel() should stop the animation and clear it so it can't be resumed, otherwise Fx.pause() and Fx.cancel() serve the same purpose, the only difference being the onCancel event being fired? If this is the intended functionality, I think this should be made clear in the docs as the function names would imply otherwise.

    $('test').set('tween', {duration: 2000}).tween('width', 100);

    Expected functionality: Animation stops half-way through
    Actual functionality: Animation pauses half-way through then is resumed and completes

  • Sebastian Markbåge

    Sebastian Markbåge July 22nd, 2009 @ 01:03 PM

    • Assigned user set to “Sebastian Markbåge”
    • State changed from “new” to “open”

    The bottom line is whether or not you can call resume() and have it be silently ignored. I think that makes sense. Another issue is whether or not duration should be reset when resumed.

  • ibolmo

    ibolmo January 19th, 2012 @ 07:03 AM

    • State changed from “open” to “invalid”
    • Milestone order changed from “0” to “0”

    Moved to Github issues:

    The use of Lighthouse has been deprecated. Please follow-up at Github Issues, or add any other issues.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Shared Ticket Bins