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 form
Nowlet’stieittogetherwithJavaScript.First,let’sdefineanactionthataddsthe
fadeclass—inthiscase,achangeeventhandler:
Transitions and Animation 205