* Options:
* btnPrev: optional identifier for previous button
* btnNext: optional identifier for next button
+ * btnPause: optional identifier for pause button
* auto: whether or not to auto-proceed
* speed: animation speed
* autoTime: time between auto-rotation
o = $.extend({
btnPrev: null,
btnNext: null,
+ btnPause: null,
auto: true,
speed: 500,
autoTime: 12000,
e.preventDefault();
return go(curr+o.scroll);
});
+
+ //Pause button
+ if(o.btnPause)
+ $(o.btnPause).click(function(e) {
+ e.preventDefault();
+ if ($(this).hasClass('paused')) {
+ startRotateTimer();
+ } else {
+ pauseRotateTimer();
+ }
+ });
//Auto rotation
if(o.auto) startRotateTimer();
go(curr+o.scroll);
}
}, o.autoTime);
+ $(o.btnPause).removeClass('paused');
+ }
+
+ function pauseRotateTimer() {
+ clearInterval(timer);
+ $(o.btnPause).addClass('paused');
}
//Go to an item
<script type="text/javascript">
$('.slideshow-container').dacSlideshow({
btnPrev: '.slideshow-prev',
- btnNext: '.slideshow-next'
+ btnNext: '.slideshow-next',
+ btnPause: '#pauseButton'
});
</script>
<?cs /if ?>