noelboss / featherlight

Featherlight is a very lightweight jQuery lightbox plugin. It's simple yet flexible and easy to use. Featherlight has minimal css and uses no inline styles, everything is name-spaced, it's completely customizable via config object and offers image, ajax and iframe support out of the box. Featherlights small footprint weights about 4kB – in total.
https://www.noevu.ch/featherlight-js-the-ultra-slim-lightbox/
MIT License
2.08k stars 293 forks source link

Options are not getting accepted in featherlight #333

Closed vincelawdev closed 7 years ago

vincelawdev commented 7 years ago

I was using 1.7.1. I thought there might be a problem with it so I tried 1.7.9 and the code below doesn't work for me.

var options = {
        variant: 'test-lightbox',
        otherClose: '.test-lightbox-close',
        closeIcon: ''
};

$('.test-lightbox-link').featherlight(options);

I noticed that my options no longer work when I pass in do not get used at all. I still see the default featherlight CSS applied.

However, it works properly if I try to use data-featherlight-option attributes in my hyperlink code.

marcandre commented 7 years ago

Are you using the autobinding feature also? Remove data-featherlight from your HTML attributes.

vincelawdev commented 7 years ago

Thanks. That worked. I am not sure how I managed to use data-featherlight attribute before. I changed it to my own custom data-lightbox attribute and it works fine now.