Jump to content

Stopping a Javascript Function Execution


papillonstudios

Recommended Posts

I was wondering how you stop a Function Execution.

 

What i have is a basic slide show. and i want when you roll over the image it plays the slideshow but when you onMouseOut it reverts back to the first image and stops the slideshow.

 

So far i have the slideshow working, the onMouseOver and onMouseOut fumctions working . except in the onMouseOut function i dont have it stopping the slideshow. heres my two functions and where im using them.

//variable that will increment through the images
var step=1
function slideit(action){
if(action == 'abort'){ 
        return
    }
//if browser does not support the image object, exit.
if (!document.images)
return
document.images.slide.src=eval("image"+step+".src")
if (step<6)
step++
else
step=1
//call function "slideit()" every 2.5 seconds
setTimeout("slideit()",1000)
}

function slideOff() {
	document.images.slide.src=eval("image1.src")
	slideit(abort)
}

<img src="contact/images/wingham/01.jpg" onmouseover="slideit()" onmouseout="slideOff()" name="slide" width=150" >

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.