Pause action on hover
Pause action on hover
I have the function below that switches DIV's between a given time interval. I'm trying to get it to pause when someone hovers over it. It switches as needed but it doesn't pause hover.
- $(function() {
- if($('.alert-box').length > 1 ) {
- setInterval(function(){
- if($('.alert-box').first().is(':visible')) {
- $(".alert-box:visible").hide().siblings().next().show();
- $('.alert-right-arrow').addClass('no-clicks');
- $('.alert-left-arrow ').removeClass('no-clicks');
-
- } else {
-
- $(".alert-box:visible").hide().prev().show();
- $('.alert-left-arrow').addClass('no-clicks');
- $('.alert-right-arrow').removeClass('no-clicks');
- }
- }, 6000);
-
- }});
-
- $('.alert-box').hover(function(){
- clearInterval();
- });