I m having a slight issue with my jQuery code. I ve basically got a timer that loops through a set of images, which is on a setInterval
当我点击右边或左边控制器时,它停止了以用户点击而不是自动点击的间隔和磨损图像。
$( a.right ).click(function () {
clearInterval(myInterval);
setTimeout(function () { slideshow(); }, 9000);
if (count < max - 1) {
$( div.feature-image ).eq(count).fadeOut( 1000 , function () {
count++;
$( div.feature-image ).eq(count).fadeIn( 1000 );
info++;
$( div.img-info ).html(info + of + max + | );
})
}
I ve used a setTimeout to wait 4seconds then continue the loop cycle. Although I don t think it s the most elegant way to do it because the Jquery doesn t know to stop the if statement. Is there a way I can on the setTimeout stop the if statement from carrying on it s function?