Book Image

Learning AngularJS Animations

By : Richard Keller
Book Image

Learning AngularJS Animations

By: Richard Keller

Overview of this book

Table of Contents (15 chapters)
Learning AngularJS Animations
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

CSS3 transitions


Before CSS3 transitions, when style properties of DOM elements were changed, web browsers applied new styles immediately after the operation, so the effects were rendered abruptly. As we saw in the last chapter, we could use JavaScript or jQuery to imperatively add a transition while changing the style. This is an option, but we already saw some reasons why CSS transitions might be a better choice. In Chapter 8, Animation Performance Optimization, we will learn more about the optimization of animations. CSS3 transitions enable developers to create implicit, smooth transitions when changing the CSS property of elements. We can avoid a loading animation to get frozen while JavaScript is under heavy processing by using CSS transitions. This will make a huge difference to the user's perception of quality.

Let's check a complete transition animation declaration and see how it works:

<!DOCTYPE html>
<html>
<head>
    <title>Chapter 2 - First sample</title...