jquery play and pause buttons to start/stop image plugin
I have an image slider plugin that gets initialized onload with this:
$('#headerwrapper img').peTransitionHilight({
slideshow: true,
transition: "all",
duration: 1234,
delay: 8888,
boost: 0.6
});
Once started it runs forever.
I'm trying to figure out how to make it startable and stoppable, as in:
<button class="play">play</button>
<button class="pause">pause</button>
I've tried many approaches but nothing gives, e.g.,
var interval;
function slideBoxTimeout(){
var interval = setInterval(function(){
slideBoxTransition();
}, delay);
}
$(".play").click(function() {
slideBoxTimeout();
});
$(".pause").click(function() {
clearInterval(interval);
});
What's a good way to start and stop this thing?
No comments:
Post a Comment