From the course: jQuery for Web Designers

Unlock the full course today

Join today to access over 22,500 courses taught by industry experts or purchase this course individually.

JavaScript or CSS for animation

JavaScript or CSS for animation - jQuery Tutorial

From the course: jQuery for Web Designers

Start my 1-month free trial

JavaScript or CSS for animation

- [Voiceover] In the next several videos we're going to work on a small animation project. But I want to step back first and talk about it a little more generally. To animate in the browser you can use CSS or JavaScript, and, therefore, jQuery, or, spoiler alert, both CSS and JavaScript together. jQuery's animate method makes JavaScript animations very easy to do. The approach you'll take with CSS or jQuery will be different, but the results can be similar. So which you choose can often be a matter of what you find most comfortable. With CSS, you're using transitions and keyframes, which are ways to move between states of DOM elements over time without using what most people would think of as code. In jQuery you use the animate method to tween numeric CSS properties over time. It's more flexible, and the code's not complex, but it is a different way of working with them than CSS alone. So besides how you write it, what are the advantages of one over the other? With CSS animations are…

Contents