li {
transition: 500ms;
}.fade {
opacity: 0;
}/* For browsers that don't support the hidden attribute */
[hidden] {
display: none;
}Addsomestylesforcolorandfontsize,andweendupwiththeexampleinFig-
ure5.7.
Figure 5.7. Our transition demo formNowlet’stieittogetherwithJavaScript.First,let’sdefineanactionthataddsthe
fadeclass—inthiscase,achangeeventhandler:
Transitions and Animation 205