-
Notifications
You must be signed in to change notification settings - Fork 161
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cancel the jump animation #44
base: master
Are you sure you want to change the base?
Conversation
btw, if anyone is interested in trying this PR... $ npm install [email protected] var jumper = require('jump.js-cancelable');
jumper.jump(...);
jumper.cancel(); |
@bretkikehara havent had time to look closely at the changes to the source, but do think this is the best approach - no event listeners, just giving the user a function to cancel the jump as they see fit. will take a look when I get the chance - thanks for the submission and taking the initiative on this one. |
So after using this a bit more, I found that exposing the timeStart is crucial to knowing the appropriate instance to cancel a jump. |
@bretkikehara Thanks, very useful patch! Minor changes:
I'd like to see
this will not break existing API, or much better:
because with custom container support, I think, will be possible to run a few jumps simultaneously. |
When jump is called expose the cancel handler to stop the animation.
Tries to solve #7 without external dependencies or extra event handlers