I'm using the following function to create an image loop on mouse-over. (I don't remember where I scavenged the code, but I didn't write it myself)
Script:
function zxcCycle(zxcimg,zxcary,zxcdly,zxcindex){
if (!zxcimg.srtimg) zxcimg.srtimg=zxcimg.src;
if (!zxcindex) zxcindex=0;
zxcimg.src=zxcimg.src.substring(0,zxcimg.src.lastIndexOf('/')+1)+zxcary[zxcindex];
zxcimg.onmouseout=function(){ clearTimeout(this.to); this.src=this.srtimg; }
zxcindex=++zxcindex%zxcary.length;
zxcimg.to=setTimeout(function(){ zxcCycle(zxcimg,zxcary,zxcdly,zxcindex); },zxcdly);
}
Html:
<a class="example_class" href="example.html"><img src="example00.jpg" onmouseover="zxcCycle(this,example_var,160);"/></a>
The image loop works perfectly. It starts on mouse-over, and stops on mouse-out. However, I'm using the same image as a link to another page – and once I visit that page, and press the "show previous page" arrow on Safari (to go back to the page with the image loop), the loop is still going.
So how do I make this not happen? I've tried using mouse-out events, and onload functions, but I can't seem to get it to work.
Thanks in advance!