I need to make a little toolbox that has some "icons" in it. These icons should swap when mouse over and mouse out.
So I made this little script:
// This is the image swap code for the tool button menu
pic1 = new Image;
pic2 = new Image;
pic3 = new Image;
pic4 = new Image;
pic5 = new Image;
pic6 = new Image;
pic1.src = "images/buttons/homeout.jpg";
pic2.src = "images/buttons/homeover.jpg";
pic3.src = "images/buttons/emailout.jpg";
pic4.src = "images/buttons/emailover.jpg";
pic5.src = "images/buttons/helpout.jpg";
pic6.src = "images/buttons/helpover.jpg";
// Image swap code ends here
This is how I use it:
<A HREF="test" ONMOUSEOVER="Home.src = pic2.src" ONMOUSEOUT="Home.src = pic1.src"><IMG SRC="images/buttons/homeout.jpg" TITLE="Home" NAME="Home" BORDER="0"></A>
Now to the questions...
1. Is this the correct way to do it??
2. How do I make the images preload, so there is no delay when the user move over it??
/Smirre
