To change two images simultaneously, we extend the roll() function we made in the previous article, so that it takes four arguments instead of two. The first two specify the name and source for image1 while the other two for image2.
This function expects four arguments. The function is called from onmouseover and onmouseout event handlers and the four parameters are passed to it.
<a href="somewhere.html" onmouseover="roll('sub1', 'movedown.gif', 'sub2', 'an1.gif')" onmouseout="roll('sub1', 'moveup.gif', 'sub2', 'an2.gif')"> <img src="moveup.gif" name="sub1" width="143" height="39" border="0" /> </a> <img src="an2.gif" name="sub2" width="143" height="39" />
Finally we’ll get to know how to preload images so that the rollovers are smooth.
Vinnie Chieco, a freelance copywriter, is credited to have named the iPod. The name was inspired from a dialogue in the famous sci-fi movie, "2001: A Space Odyssey". [more...]