I have slider set to click the next button every 5 seconds by using setInterval. My plan is that when you hover over the image this clicking stops. The only way I can think of doing this is by writing a new setInterval on hovering thats so long that nothing would happen. But this doesnt work as it doesnt override the original one.
Is there a way to do this in jQuery? All Im looking to do is stop the click trigger on hovering....
setInterval(function() {
jQuery('.next_button').trigger('click');
}, 1000);
$(".main-slide img").hover(function () {
setInterval(function() {
jQuery('.next_button').trigger('click');
}, 60000000);
},
function() {
setInterval(function() {
jQuery('.next_button').trigger('click');
}, 1000);
}
);