Using Featherlight and JQuery, I have a lightbox :
<div class="lightbox" id="mylightbox"> Text to display in box </div>
Instead of using a link, that I do not need, to open it as :
<a href="#" data-featherlight="#mylightbox">Open element in lightbox</a>
I would like to trigger it in a javascript function :
$('lightbox.mylightbox').featherlight({ });
I tried with featherlight.click or featherlight.open but it did not work. Thxs for your help.
2nd Edit :
Just found the solution as calling $('lightbox...
only sets configuration parameters.
I made a forced click on the <a id="f1" ... >
link through the following javascript function :
$('f1').click();
Featherlight is the lightbox plugin used here. No need to force a click.
<div id="mylightbox">Text to display in box</div>
$.featherlight($('#mylightbox'), {});
Demo
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With