Closed danro closed 12 years ago
what's jQuery's usecase?
Here's a quote from their stop()
docs:
When .stop() is called on an element, the currently-running animation (if any) is immediately stopped. If, for instance, an element is being hidden with .slideUp() when .stop() is called, the element will now still be displayed, but will be a fraction of its previous height. Callback functions are not called.
and...
If the jumpToEnd property is provided with a value of true, the current animation stops, but the element is immediately given its target values for each CSS property. In our above .slideUp() example, the element would be immediately hidden. The callback function is then immediately called, if provided.
Also, from my previous experience with just about any AS3 tweening engine, when you stop a tween in progress- the callback should be ignored. Sort of like setTimeout
and clearTimeout
in javascript.
If you're hesitant to change the way callbacks work with tween.stop()
then perhaps morpheus needs a tween.clear()
or something to make sure the callbacks don't fire?
nah this is fine.
i added tests after the merge and then published to npm
sweet, glad I could help. this is a great script.
This will change
tween.stop
to behave more likejQuery.stop
... the callback should be removed whenstop()
is called, unless jump to end is true. (Then the callback would fire right away)