visionmedia / move.js

CSS3 backed JavaScript animation framework
http://visionmedia.github.com/move.js/
4.72k stars 686 forks source link

Remove animation properties after animation is completed #65

Open carlmathisen opened 9 years ago

carlmathisen commented 9 years ago

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

carlmathisen commented 9 years ago

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.

jamesaspence commented 8 years ago

Could you not just remove that style manually from the ones you want?

jlma7 commented 8 years ago

I just use jquery to solve the problem. http://api.jquery.com/animate/

carlmathisen commented 8 years ago

@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? :-)