[thelist] [Javascript] FIXED swicthing off a function
Ben Morrison
ben.morrison at dogstardesign.co.uk
Thu Jan 15 11:07:05 CST 2004
On 15/1/04 12:58 pm, "Hershel Robinson" <hershelr at netvision.net.il> wrote:
> Make sure you leave your mouse ON the image for the full 2 seconds, or you
> could end up with cycles. Because the setTimeout didn't have time to see
> that you rolled over.
>
> It might be smarter to consider using a variable to hold your timeout and
> then using clearTimeout to end that timeout onrollover.
Simpler solution to what I had, used clearInterval instead:
function enableRotate() {
slideTimer = setInterval('rotateImage()', 4000);
}
function disableRotate() {
clearInterval(slideTimer);
}
Thanks
ben
More information about the thelist
mailing list