Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Use Velocity.js or Transit.js for CSS/JS/jQuery animations?

I have been using jQuery's .animate() to animate websites and absolutely love how it works. However I just learned that Velocity.js and Transit.js perform way faster, can animate CSS3 transitions and can be used in jQuery just like .animate().

Should I use Velocity.js or Transit.js for animations? And why?

like image 392
Jan Werkhoven Avatar asked Mar 18 '23 20:03

Jan Werkhoven


1 Answers

According to the tests on this page, velocity is the best(gives smoothest animations): Speed Test http://codepen.io/GreenSock/pen/pmknI

Using these libraries greatly increased the smoothness of my animations on mobile devices.

However I've done tests on memory consumption (looking at browser's task manager) and I saw that every time I did the animation with velocity or transit, it used up a lot more memory (3MB) every time I kicked off the animation ( not to mention it took the Garbage Collector a long time to reclaim this memory)

On the other hand calling jQuery's animate used an average 1MB to perform the same animation.

like image 57
Ronald Avatar answered Mar 26 '23 04:03

Ronald