Hello everyone,
I am working on a project. I need to use SetInterval so a function will execute over and over until i clear the interval. The problem i am having is that after the interval is cleared, I can't set it again. I am getting a error that the object doesn't support that property or method.
It works fine when I first start it, but the problem is restarting it. I am wondering if there is something i have to do to the variable once after i clear the interval.
Here is my code.
function AutoPlay(){
AutoPlay = setInterval(function(){ShowSlide(2)},6000);
}
function StopAuto(){
clearInterval(AutoPlay);
}
Please help me out.I think i need to set the AutoPlay Variable to nul or something like that.
Thanks,


Reply With Quote
Bookmarks