O'Reilly logo

Practical Web Technologies by V. Lau, P. K. Yuen

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

6.2. Beginning mouse over (or rollover)

6.2.1. My first mouse-over page

In this section, a mouse-over technique that will work on all major browsers and versions is introduced. Our first mouse-over (or rollover) HTML page will display a picture. This picture will change to another one when a mouse runs over it. You are bound to have seen lots of Web pages with this feature and may wonder how they do it. You may be surprised to find out that this can be done by just three lines of code:

Listing . ex06–02.txt
   1:     <a href="#" onmouseover='document.my_img.src="rody04.gif"'>
   2:        <img alt="pic" id="my_img" name="my_img" src="logo_web.jpg" />
   3:     </a>

These lines of code may look strange. Believe it or not, they are very popular among Web professionals. ...

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