O'Reilly logo

Javascript for the World Wide Web: Visual Quickstart Guide, Fifth Edition by Tom Negrino, Dori Smith

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 4. Image Basics

One of the best uses of JavaScript is to add visual interest to Web pages by animating graphics, and that's what this chapter is all about. Making an image on a Web page change when the user moves the mouse over the image, thereby making the page react to the user, is one of the most common—and effective—tricks you can learn in JavaScript. This rollover, as it is called, is easy to implement, yet has many applications, as you'll see.

In this chapter, you'll learn several ways to implement rollovers on your pages, and how to use functions to make coding multiple rollovers easier.

Table 4.1. Just Enough HTML—Images

TAG

ATTRIBUTE

MEANING

img

 

Contains the attributes that describe the image to be displayed by the browser

 

src

Contains ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required