Building Three-State Rollovers

A three-state rollover is one where the rollover has three versions. Besides the original image and the version that appears when the user places the cursor over the image, there is a third version of the image when the button itself is clicked, as shown in Figure 4.5.

Figure 4.5. When the button is clicked, you get a third image (hard to see in this grayscale image; check our companion Web site for the full effect).

Script 4.4, the HTML file, looks almost exactly the same as Script 4.2 from the previous task. In fact, the only differences are the document’s title and the name of the external JavaScript file ...

Get JavaScript and Ajax for the Web: Visual QuickStart Guide, Seventh Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.