Search code examples
jquerytimeoutdelayjquery-toolsscrollable

How to set delay after clicking at navi of jquery tools scrollable?


I use http://jquerytools.org/documentation/scrollable/ with plugins navigator and autoscrolling for animation of banners. I have such part of the code:

$('.scrollable')
    .scrollable({ 
        circular: true,
        speed: 2000
    })
    .navigator({
        navi: '.navs'
    })
    .autoscroll(5000);

It works nice, but I want to have also opportunity to set delay time after choosing of certain banner (after clicking on one of $('.navs')). Is there any way to make what I want?

UPDATE. I can set $('.scrollable').scrollable({ clickable: false ...})... to stop scrolling at all.But I still want to continue it after certain delay.

http://jsfiddle.net/WqL8T/1/


Solution

  • http://jsfiddle.net/WqL8T/5/ - working example. Thanks to MichaelKaeser. I have just corrected syntax in a right way:

    var api = $(".scrollable").data("scrollable");
    $('.navs').on('click',function(){
      api.stop();
      var resume = api.play;
      setTimeout(resume, 3000);
    });