move.js
move.js copied to clipboard
Remove animation properties after animation is completed
Hi!
Thank you for a great library.
I was wondering, if I first animate a box like this:
move('#square').to(300, 200).end();
And then I want to position the box without an animation, like in this pure JS example:
document.getElementById('square').style.transform = "translate(200px, 200px)";
It will animate with move.js's settings, because
transition-duration: 500ms;
is not removed from element styles when the animation is completed. By design?
I think those styles should be removed when end() is triggered.
Carl
The question is, how does one know which ones to keep and which ones to discard? By using .to() to position the element, I still want to keep the translate property while removing everything else. There probably are similar "end state" issues with every animation.
Could you not just remove that style manually from the ones you want?
I just use jquery to solve the problem. http://api.jquery.com/animate/
@jamesaspence Sure, but it should be handled my move.js.
@jlma7 So if I use jQuery.animate, what's the point of using move.js then? :-)