ashleydw / lightbox

A lightbox gallery plugin for Bootstrap
http://ashleydw.github.io/lightbox
MIT License
1.85k stars 1.3k forks source link

Diaporama #248

Open flierville opened 7 years ago

flierville commented 7 years ago

Do you think is it possible to add diaporama ?

thanks a lot ;)

flierville commented 7 years ago

I found a jQuery Solution to make a slideshow

$(document).on('click', '[data-toggle="lightbox"]', function(event) {
        var slideShowInterval
        event.preventDefault();
        $(this).ekkoLightbox({
            onShown: function() {
                if(typeof fliSlideShowInterval !== "undefined" && fliSlideShowInterval != 0){
                    slideShowInterval = setInterval(
                        function(){
                            $("a",$('.ekko-lightbox-nav-overlay')).eq(1).click()
                        },
                        fliSlideShowInterval
                    );
                }

            },
            onHide: function(){
                //Fermeture image = fin diaporama
                if(typeof fliSlideShowInterval !== "undefined") {
                    clearInterval(slideShowInterval);
                }
            }
        });
    });