With all the talk of roll overs - I'd thought I'd post a nifty script that I use for my rollovers. It works with IE (4,5) and NS (3,4). BTW - I didn't write this, don't shoot the messenger. ;-)
+++++++++++++++++++
All-In-One Simple Rollover JavaScript....Put the following in between the header tags...
<SCRIPT><!--// Handles rollover images for NN3+ and IE4+var loaded = new Array();To implement....Here's an example URL and Image Tag:function F_loadRollover(image,imageName) {
if (image && image.src && (null == image.out || typeof(image.out) == typeof(void(0)))) { s = image.src; image.out = new Image(); image.out.src = s; image.over = new Image(); if (imageName.lastIndexOf('/') >= 0 || imageName.lastIndexOf('\\') >=0) { s = imageName; } else { i = s.lastIndexOf('/'); if (i<0) i = s.lastIndexOf('\\'); if (i<0) { s = imageName; } else { s = s.substring(0,i+1) + imageName; } } image.over.src = s; loaded[image.name] = image; }}function F_roll(imageName,over) { if (document.images) { if (over) { imageObject = "over"; } else { imageObject = "out"; } image = loaded[imageName]; if (image) { ref = eval("image."+imageObject); if (ref) image.src = eval("image."+imageObject+".src"); } if (window.event) window.event.cancelBubble = true; }}//--></SCRIPT>
<A HREF="/www/path/to/page.html" onMouseOver="F_roll('ImageName',1)"onMouseOut="F_roll('ImageName',0)"><IMG NAME="ImageName" SRC="/www/path/to/imageLO.gif"onLoad="F_loadRollover(this,'/www/path/to/imageHI.gif')" BORDER=0 ALT="Home"></A>
Don't touch the JavaScript itself, it's written to be self contained. There should be nothing you have to do there. All the work is setting up the URL and IMAGE tags.
### How does this work??? ####
Here's my flimsy two cents, since I am NOT the JavaScript Guru:
When the images are loaded, you'll notice that the second image is loaded via the first JavaScript Function (F_loadRollover). This function creates an Array of Images using the Name of the image during the page load. When the mouse overs are invoked they call the second Java Script Function (F_roll). The second function takes the name of the image and '1' or '0'. With that info, it invokes the proper image via the array built previously and makes that one auto-magically appear.
Ta Da. Image rollovers.
Good Luck.....Hope this helps or at least does not hurt.
--
Anthony Baratta