mreq / slick-lightbox

A lightbox wrapper for Ken's amazing slick carousel.
http://mreq.github.io/slick-lightbox/
MIT License
229 stars 103 forks source link

Button opens lightbox: this.options.lazy issue #74

Closed ishetnogferre closed 6 years ago

ishetnogferre commented 6 years ago

EDIT: I was using the npm package, which is version 0.2.10, so switched to the cdn one version 0.2.12, that fixed the problem.

Hi,

When I wanna use just a button that opens a set of images into a lightbox, I'm getting the following console error: "Cannot read property 'options' of undefined". Traced it back to the following code in the plugin:

screen shot 2018-09-14 at 16 52 32

It seems the 'this.options.lazy' isn't defined here, or am I forgetting an options field somewhere? (If I replace the 'this.options.lazy' here, it all works)

Javascript behind the button(s):

<script>
    $('.photo-album').each(function(){
        var self = $(this);
        $(this).slickLightbox({
            images: self.data('images'),
        });
    });
</script>
mreq commented 6 years ago

Ye, that was fixed in 0.2.11.