Chapter 5. More Fun with Images

In Chapter 4, you mastered rollovers, the most common usage of JavaScript with images. But you can do much more than rollovers with JavaScript, and that's what you'll find in this chapter.

Images give Web pages life, and you can use JavaScript to automatically change images, create ad banners, build slideshows, display random images on a page, and even use a rollover in conjunction with an image map to give the user some interesting interface choices. Let's get started.

Table 5.1. Just Enough HTML—Images






Contains the area elements defining the links and locations for image maps



The identifier used by the usemap attribute of the img tag



Defines the elements of the image map



Defines ...

Get Javascript for the World Wide Web: Visual Quickstart Guide, Fifth Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.