In This Chapter
Hiding and showing elements with jQuery
Fading elements in and out
Adding a callback function to a transition
Using selection filters
Adding and removing elements
To get it all started, take a look at
hideShow.html shown in Figure 3-1.
hideShow program looks simple at first, but it does some quite interesting things. All of the level-two headings are actually buttons, so when you click them, interesting things happen:
show button displays a previously hidden element. Figure 3-2 demonstrates the revealed content.
hide button hides the content. The behavior of the
hide button is pretty obvious. If the content is showing, it disappears instantly.
toggle button swaps the visibility of the content. If the content is currently visible, it is hidden. If it is hidden, it appears.
slide down button makes the content transition in. The slide down transition acts like a window shade being pulled down to make the content visible through a basic animation.
Figure 3.1. This ...