var x, currentSlide ; function nextSlide(slide){ x = setTimeout //... x = setTimeout //... x = setTimeout } $("#blok").mouseenter(function(){window.clearTimeout(x)}).mouseleave(function(){nextSlide(currentSlide); });