play/stop button for Slideshow
hi everyone
i am new in jquery and the jquery code is:
- function slideShow() {
var showing = $('#wrap .is-showing');
var next = showing.next().length ? showing.next() : showing.parent().children(':first');
showing.fadeOut(800, function () {
next.fadeIn(800).addClass('is-showing');
}).removeClass('is-showing');
slideShow.timeout = setTimeout(slideShow, 5000);
}
slideShow.stop = function(){
clearTimeout(slideShow.timeout)
}
this code changes images every 5 seconds.
i want to push the play button to start the slideshow
than i want to push the stop button to stop the slideshow
how should i solve this problem?
thanx