Closed pwFoo closed 7 years ago
@pwFoo I found that users are more likely to watch galleries in their own speed rather than in predefined slideshows, thats why I didnt implement it yet. But actually this is pretty simple to do it yourself:
var slideshowTimer = null;
var lightbox = new Lightbox();
function startSlideShow(){
slideshowTimer = window.setInterval(function(){
lightbox.next();
},5000); // time in milliseconds
};
function stopSlideShow(){
window.clearInterval(slideshowTimer);
};
lightbox.load({
onopen: function (image) {
startSlideShow();
},
onclose: function (image) {
stopSlideShow();
}
});
And to add a play / pause button just create your own button (be sure to only display it when the box is open) and on button-click call startSlideShow()
or stopSlideShow
.
A slideshow feature with play button would be great.