我想在容器 div 的悬停上停止并启动一个函数,我尝试了 myLoop.stop(); 重置变量,但它不能正常工作......有什么想法吗???
//Continuous Scroll
var nex = 1;
var timeInterval = 1000;
$(".logoContainer").hover(function(){
// Stop Function Here
},function () {
// Start Function Here
})
function myLoop () { // create a loop function
setTimeout(function () { // call a 3s setTimeout when the loop is called
if( cache.isAnimating ) return false;
cache.isAnimating = true;
aux.navigate( 1, $el, $wrapper, settings, cache );
nex++;
if (nex < 100) {
myLoop();
}
}, timeInterval)
}
myLoop();