JavaScript Images: Rollover There are any number of rollover scripts on the Internet that will cause images to "flip" or "change" when you roll over them with the cursor. Here is one sample. Designing the on/off images can be the challenging part. Look at some of the images out on the web and try to create your own with an image editing software package. Or, buy some clip art or use the "free" samples on the web. After you have the two (on and off) images in mind, put this script inside the <head> tag: (Note that each of the function statements below should be on one line.) This particular script requires that images are the same size.
browserName = navigator.appName; // detect browser browserVer = parseInt(navigator.appVersion); function change1 (picture){if ((browserName == 'Netscape' && browserVer >= 3)||(navigator.appName.substring(0,9) == 'Microsoft' && browserVer >= 4)){document.bullettag1.src = picture}} function change2 (picture){if ((browserName == 'Netscape' && browserVer >= 3)||(navigator.appName.substring(0,9) == 'Microsoft' && browserVer >= 4)){document.bullettag2.src = picture}} function change3(picture){if ((browserName == 'Netscape' && browserVer >= 3)||(navigator.appName.substring(0,9) == 'Microsoft' && browserVer >= 4)){document.bullettag3.src = picture}} </script> In copy, use the following code for the image call-out:
<a href="next.htm" onMouseOver="change2('/images/another_on.gif')" onMouseOut="change2('/images/another_off.gif')"><img src="/images/another_off.gif" border="0" alt="Javascript" name="bullettag2" border="0" width="81" height="19"></a> <a href="again.htm" onMouseOver="change3('/images/another_on.gif')" onMouseOut="change3('/images/another_off.gif')"><img src="/images/another_off.gif" border="0" alt="Javascript" name="bullettag3" border="0" width="81" height="19"></a> |