本文介绍了在上一张图像上的Fancybox 2操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚更新到Fancybox 2,发现它比以前的版本好得多.
I have just updated to Fancybox 2 and find it much better than previous version.
我想知道的是,如果有一种方法可以在到达画廊中的最后一个元素时触发一个函数...现在它会循环,但是我想回叫另一个函数以加载更多图片!
What I would like to know is that if there's a way to trigger a function when it reaches the last element in gallery...right now it loops, but I would like to call back another function to load more pictures!
预先感谢您,妮可(Nicolo)
Thank you in advance,Nicolo'
推荐答案
您可以尝试:
$('.fancylink').fancybox({
loop: false,
afterShow: function(){
if(this.index == this.group.length - 1){
alert('I am the last item of the gallery');
}
}
}); // fancybox
它将在显示画廊的最后一个元素后立即显示警报.
It will show the alert just right after the last element of the gallery has been shown.
这篇关于在上一张图像上的Fancybox 2操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!