O'Reilly logo

Mastering JavaScript High Performance by Chad R. Adams

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Animating elements

One of the more impressive uses of JavaScript came around the Web 2.0 age of JavaScript while AJAX was gaining popularity; another interesting idea came about in the form of JavaScript animations. These are animations that are created by simply iterating over and over an element's styles that are left- and top-positioned using a setInterval function, and then dismissing it after the element reached its end point. This allows the div to appear to tween or animate on the page itself.

Animating the old-fashioned way

Most JavaScript developers are familiar with doing animations using jQuery, the popular DOM manipulation library for JavaScript, using the animate function to create DOM animations. But, as we are talking about pure JavaScript ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required