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

TAG

ATTRIBUTE

MEANING

map

 

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

 

name

The identifier used by the usemap attribute of the img tag

area

 

Defines the elements of the image map

 

shape

Defines ...

Get Javascript for the World Wide Web: Visual Quickstart Guide, Fifth 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.