Using Featherlight and JQuery, I have a lightbox :
我用了鹅光和JQuery,有了一个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 :
我想用javascript函数来触发:
$('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 :
第二次编辑:刚刚发现解决方案为$(“lightbox…”只有设置配置参数。我强行点击了链接通过以下javascript函数:
$('f1').click();
$(f1).click();
1 个解决方案
#1
4
Featherlight is the lightbox plugin used here. No need to force a click.
翎羽灯是这里使用的lightbox插件。不需要强制点击。
HTML
<div id="mylightbox">Text to display in box</div>
JS
$.featherlight($('#mylightbox'), {});
演示
#1
4
Featherlight is the lightbox plugin used here. No need to force a click.
翎羽灯是这里使用的lightbox插件。不需要强制点击。
HTML
<div id="mylightbox">Text to display in box</div>
JS
$.featherlight($('#mylightbox'), {});
演示