-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Learning AngularJS Animations
By :
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...
Change the font size
Change margin width
Change background colour