ashleydw / lightbox

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

Passing options object breaks page #175

Closed gbot closed 8 years ago

gbot commented 8 years ago

Hi, Thanks so much for this plugin. I've got it working nicely, but if I try and pass some options to the calling function the page completely breaks. I've looked at the source for your demo and as far as I can determine, I'm doing it correctly.

I've added the ekko-lightbox.js to the page, and then use:

<script>
    $(document).delegate('*[data-toggle="lightbox"]', 'click', function(event) {
    event.preventDefault();
    $(this).ekkoLightbox({always_show_close: false});
});
</script>

Using this, my page breaks completely. If I remove {always_show_close: false} it works again.

Any ideas what could be wrong?

Thanks again.

gbot commented 8 years ago

My bad, I had the calling function in a smarty template file and it didn't like it. Moved it to it's own .js file and now it works fine.