Forum Moderators: open

Message Too Old, No Replies

How do I stop a javascript function

finding a function that stops a script

         

bitstomper

12:17 am on Jan 26, 2007 (gmt 0)

10+ Year Member



Hi there,

I have installed a slideshow, which plays on a mouseover but I want it to stop on mouseout. How do I establish this?

Here is the code:

<SCRIPT language="JavaScript">

var slideShowSpeed = 3000

var crossFadeDuration = 3

var Pic = new Array()

Pic[0] = image2.src
Pic[1] = image3.src
Pic[2] = image4.src
Pic[3] = image5.src
Pic[4] = image6.src
Pic[5] = image7.src
Pic[6] = image8.src
Pic[7] = image9.src
Pic[8] = image10.src
Pic[9] = image_off.src

var t
var j = 0
var p = Pic.length

var preLoad = new Array()
for (i = 0; i < p; i++){
preLoad[i] = new Image()
preLoad[i].src = Pic[i]
}

function runSlideShow(){
if (document.all){
document.images.SlideShow.style.filter="blendTrans(duration=2)"
document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)"
document.images.SlideShow.filters.blendTrans.Apply()
}
document.images.SlideShow.src = preLoad[j].src
if (document.all){
document.images.SlideShow.filters.blendTrans.Play()
}
j = j + 1
if (j > (p-1)) j=0
t = setTimeout('runSlideShow()', slideShowSpeed)
}

</script>

<a href="#" onMouseover="runSlideShow()" ><img src="images/dots/slidedot.gif" width="43" height="44" /></a>

Thanks

mehh

6:26 pm on Jan 26, 2007 (gmt 0)

10+ Year Member



clearTimeout() [google.com]
you would need to clear t as your variable