|
-
Feb 8th, 2006, 03:58 PM
#1
Thread Starter
Junior Member
clearTimeout() ???
i'm having some difficulties getting my clearTimeout() to work. is there a master command that will clear any instance of timeout? or do i have to clear everyone individually?
I am the perfect example of what happens when you stop programming for 2 years.
-
Feb 8th, 2006, 05:00 PM
#2
Thread Starter
Junior Member
Re: clearTimeout() ???
javascript
i'll go into a little more detail of what is going on and mabe that wil help.
i have a slideshow and a menu. when you mouse over on the images in the menu, the slide show image will change to the appropriate image and pause the show. (clearTimeout()). when the mouse leaves the image, the slide show should be resumed.
the problem comes when i roll the mouse up and down the menu. the slide show resumes just fine, but instead of my 2.5 second delay on the image rotation, it goes though my images super quickly.
i'm thinking this is because i'm setting multiple instances of setTimeout() and that they arn't clearing properly.
i thought there was a command that was like a master clearTimeout() but i don't remember. i'm going to try a couple more things and if that doesn't work i'll post my code up here.
I am the perfect example of what happens when you stop programming for 2 years.
-
Feb 8th, 2006, 05:10 PM
#3
Thread Starter
Junior Member
Re: clearTimeout() ???
the code is rather big because i used some of the stuff that comes with dreamweaver to handle the image swaps. didn't want to post it all because its kinda big, but here is the part where the problems is.
Code:
//this preloads the images used in the slide show
function preloadImgs(){
if (slideshow==true){
for(var i=0;i<image.length;i++){
MM_preloadImages(image[i]);
}
}
else if (slideshow==false){
mytime = clearTimeout('randomImages()', delay);
}
}
//this begins the slide show
function randomImages(){
mytime = clearTimeout('randomImages()', delay);
if (slideshow==true){
if(counter == (image.length)){
counter = 0;
}
doit(counter++);
mytime = setTimeout('randomImages()', delay);
}
else if (slideshow==false){
mytime = clearTimeout('randomImages()', delay);
}
}
//this section of functions begins the stuff made by dreamweaver to handlde the image swapping
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
slideshow = true;
mytime = clearTimeout('randomImages()', delay);
randomImages();
}
I am the perfect example of what happens when you stop programming for 2 years.
-
Feb 9th, 2006, 08:31 AM
#4
Thread Starter
Junior Member
Re: clearTimeout() ???
oh come on, i find it hard to beleive no one has any suggestions...
I am the perfect example of what happens when you stop programming for 2 years.
-
Feb 9th, 2006, 10:46 AM
#5
Re: clearTimeout() ???
Personally I don't have any suggestions because I suck with Javascript, but there are other people that might. Now can we please not bump threads this soon?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|