You can do something like this: http://jsbin.com/uzixi3/5/edit
Here is the interval:
var int = setInterval($.fn.nextSlide, 3000); $("#slideNavigation a").click(function() { clearInterval(int); setTimeout(function() { setInterval($.fn.nextSlide, 3000); }, 10000); });
I made some other adjustments, although, for example, you can use the switch to make .nextSlide() more readable and cheaper.
In general, there is no reason to make these functions as extension methods in jjquery itself, since they do not interact with objects, they can simply be methods covered by closure as follows: http://jsbin.com/uzixi3/6/edit
If the methods were actually executed on $('#slideContainer') , for example. $('#slideContainer').nextSlide() and inside your methods that you used this.animate() and this.css() , this might make a little more sense, but just some thoughts that can help you become more flexible , When you go.
Nick craver
source share