javascript - jCarouselLite reset autoscroll interval -


After some incident, how can I reset the auto-scroll interval on my hindolal so that you can see the content Full interval, no matter how far the timer is, when you used to click next or previous? Right now, if I click on next or previous after 9 seconds, then it scrolls again after 1 second.

On lines 274-277 where auto-scroll setInterval I know that you can use the clear interval if you have an ID returned by the set intern, but no one can get me out of modifying the source code, and I do not Want to do

Any thoughts? Thanks!

jCarouselLite does not provide an easy way to automatically prevent auto-scrolling, which would be a simple problem Is what you want (? I thought it was right: you just want to stop the automatic scroll on click and then want to continue)

Hackney + to completely prevent autoscroll There is a potentially small train for

  var x; // hold interval id $ (function () {var y = window.setInterval; // Original set interface functions / overwrites with new function of backup that stores ID for us window.setInterval = function () {X = y (arguments [0], logic [1]); return x;}; now constructing carousel $ (". AnyClass"). JCarouselLite ({btnNext: ".next", btnPrev: ".prev", Auto: 500}); // Restore the original set interlabel function / / as we just need a custom one for the carousel, which has hidden internal dial call Kset Intrtrl = y;}) to set Ain window; $ ("# StopAutoScrollButton") Click (function () {clear interval (x);});  

real solution

Because we can not get jCarouselLite to do it on our own, we automatically emulate the auto behavior

  $ (function () {var autotime = 5000; // 5 s $ (". Anyclass"). JCarouselLite ({btnNext: ".next", btnPrev: ".prev "}); // Simulate autoscroll by simulating" click "on the next script var x = setInterval (" $ ('. Next.)' Trigger ('click'); ", autotime); // if on stop auto If clicked, autoscroll is suspended Autotime // No matter how far before the timer was with $ ("# stop ato"). Click (function () {clear interval (x); x = setInterval ("$ ('. '). Trigger (' click '); ", autotime);});});  

Comments

Popular posts from this blog

c# - How to capture HTTP packet with SharpPcap -

php - Multiple Select with Explode: only returns the word "Array" -

php - jQuery AJAX Post not working -