You are here: irt.org | FAQ | JavaScript | Image | Q327 [ previous next ]
Use the setTimeout() method with a delay in milliseconds:
<SCRIPT LANGUAGE="JavaScript"><!-- function swapImage(name,image) { document.images[name].src = image; } //--></SCRIPT> <A HREF="apage.html" onMouseOver="swapImage('myImage','on.gif')" onMouseOut="setTimeout('swapImage(\'myImage\',\'off.gif\')',1000)"> <IMG SRC="off.gif" NAME="myImage" BORDER="0" WIDTH="16" HEIGHT="16"></a>