1. Home
  2. Computing & Technology
  3. JavaScript

Rollover Gallery with Captions

1. Introduction and Sample

clr gif
Join the Discussion

Questions? Comments?

More of this Feature

Obtain the Script Add to Your Page

Have you seen web pages where there is a row of small images and one larger image and the larger image changes when you move the mouse over one of the smaller ones? You can get that effect using my Rollover Gallery script.

What that script doesn't give you is the ability to have a caption associated with the larger image that is updated whenever the image is changed by rolling over one of the smaller images. A few simple changes to the script can rectify that and allow us to update the associated text (regardless of where it appears on the page relative to the image).

Here is an example of the image gallery script that has been modified to update a caption whenever the image changes. In this case I have the caption as a paragraph under the image but you can put it whereever you like. Just move your mouse over any of the smaller images to replace the larger image and associated caption.

1 1 1

Larger version of one of the smaller images above

Picture One

If this is the effect that you want to add to your page then the next step is to obtain the script.

Explore JavaScript
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. JavaScript

©2009 About.com, a part of The New York Times Company.

All rights reserved.