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. ...

Get Practical Web Technologies 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.