|
Q327 How can I place a delay between onMouseOut and the swapping back of the image?
irt.org | Knowledge Base | JavaScript | Image | Q327 [ previous next ]
Q327 How can I place a delay between onMouseOut and the swapping back of the image?
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>
|
|
|
Copyright © 1996-2009 irt.org, All Rights Reserved.