jqueryslideshowlightboxmagnific-popup

Autoplay (slideshow) a lightbox gallery in magnific lightbox?


I've been looking for a responsive lightbox that will autoplay a gallery starting at a specified point in the gallery. Magnific Popup looks pretty solid. Anyone have a way for it to act as a lightbox slideshow - that is, have the gallery autoadvance?

Looks from the Magnific documentation like there should be a way that makes use of magnificPopup.next();, magnificPopup.updateItemHTML(); and/or callback events, but that's beyond my javascripting

thanks!

edit: if you're thinking "umm fancybox's autoPlay?," sure, that would work also. I'd still like to try out Magnific


Solution

  • Simply put interval in open callback.

    callbacks: {
        open: function() {
           setInterval(function() {
                $.magnificPopup.instance.next();
           }, 2000);
       }
    }
    

    Of course it's very basic implementation, but you may go as far as you need.