Chapter 4: Working with Images

Return to Chapter 4

 

To use this script on your own page, click in the text area below, select all, and copy to grab the script. Then, just paste into your own page — and you're done.

Building Three-State Rollovers

See it run: Building Three-State Rollovers

Script 4.4

Because the JavaScript is in an external file, the HTML for the three-state rollover is almost identical to the two-state rollover.

Script 4.5

This JavaScript adds a third image property for the click state.

Images:

button1_on.gif
button2_on.gif
button1_off.gif
button2_off.gif
button1_click.gif
button2_click.gif