[英]how to call js function in lightgallery onCloseAfter.lg method?
im using the lightgallery
jquery plugin from https://sachinchoolur.github.io/lightGallery/我正在使用来自https://sachinchoolur.github.io/lightGallery/的
lightgallery
jquery 插件
so the lightgallery
is working properly.所以
lightgallery
工作正常。 In lightgallery
there is a method onCloseAfter
which means Executes immediately once lightgallery is closed
在
lightgallery
中有一个方法onCloseAfter
这意味着Executes immediately once lightgallery is closed
Here is the code这是代码
var $lg = $('.lightgallery');
$lg.on("onCloseAfter.lg", function() {
alert('onCloseAfter : Executes immediately once Colorbox is closed;');
Test();
});
simple js
function简单的
js
function
function Test(){
alert("hello")
}
Test
function trigger once when the lightgallery
is closed how to call this function
everytime when the lightgallery
is closed?灯
lightgallery
关闭时Test
function 触发一次 每次lightgallery
廊关闭时如何调用此function
?
Any help would be appreciated and thanks in advance任何帮助将不胜感激,并提前感谢
According to the documentation of lightGallery this shoud work根据lightGallery的文档,这应该工作
var $lg = $('#lightgallery');
$lg.lightGallery();
// Fired immediately once lightgallery is closed.
$lg.on('onCloseAfter.lg', function (event) {
Test();
});
function Test() {
alert("hello")
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.