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" >

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.