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.

  1. $(function() {
  2. if($('.alert-box').length > 1 ) {
  3.        setInterval(function(){    
  4.    if($('.alert-box').first().is(':visible')) {
  5. $(".alert-box:visible").hide().siblings().next().show();
  6. $('.alert-right-arrow').addClass('no-clicks');
  7.     $('.alert-left-arrow ').removeClass('no-clicks');
  8.  
  9.         } else { 
  10.          $(".alert-box:visible").hide().prev().show();
  11. $('.alert-left-arrow').addClass('no-clicks');
  12. $('.alert-right-arrow').removeClass('no-clicks');
  13. }
  14. }, 6000);
  15.  
  16. }});
  17.  
  18. $('.alert-box').hover(function(){
  19.     clearInterval();
  20. });