Pause auto-rotate on mouseover (jQuery)

Posted by Nimbuz on Stack Overflow See other posts from Stack Overflow or by Nimbuz
Published on 2010-04-26T14:31:03Z Indexed on 2010/04/26 14:33 UTC
Read the original article Hit count: 205

I'm using a content slider plugin that is nice but lacks one important feature: does not stop auto-rotating slides on mouseover.

Here's the relevant part from the script:

var dotimer = function (x){
    if((opts.auto) == true) {
        if(timer != null) 
            clearInterval(timer);

        timer = setInterval(function() {
                $(opts.next).click();
                }, 3000);
    }
}

dotimer();

Full script can be previewed here

I want the rotation to pause on mouseover and resume on mouseout.

Thanks in advance for your help!

© Stack Overflow or respective owner

Related posts about jQuery

Related posts about JavaScript