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.

Making Multiple Links Change a Single Rollover

See it run: Making Multiple Links Change a Single Rollover

Script 4.8

In this HTML, each of the links and images on the page have a unique id.

Script 4.9

This JavaScript handles the multiple links and images. When the user rolls over a link, the image changes.

Images:

DaVinci.jpg
leoText.gif
flyer.gif
bg.gif
tank.gif
helicopter.gif
flyerText.gif
tankText.gif
helicopterText.gif