I've searched around different posts but still can't understand what to do entirely.
Here is my setInterval code for a slider. As it's a slider the interval begins on page load. Once I mouseleave the interval speed is faster, which means I have two going on at the same time I'm assuming, however I'm not sure how to smoothly stop it at mouseenter and get it going again at the same pace on mouseleave.
var interval = setInterval(slideInterval, 4500);
$('.main-container').on('mouseenter', function(){
clearInterval(interval);
});
, $('.main-container').on('mouseleave', function() {
setInterval(slideInterval, 4500);
});