好的,只是出于娱乐目的,并且基于imran-a在此GitHub问题上的评论,这是您被黑的解决方案:
$(".fancybox").fancybox({ loop: false, beforeLoad: function () { if ((this.index == this.group.length - 1) && !done) { ajaxGetNextImages(); done = true; this.group.push( { href: "images/04.jpg", type: "image", title: "Picture 04", isDom: false }, { href: "images/05.jpg", type: "image", title: "Picture 05", isDom: false }, { href: "images/06.jpg", type: "image", title: "Picture 06", isDom: false } ); // push } // if } // beforeLoad}); // fancybox注意 ,除了调用
ajaxGetNextImages()(将新图像放置在文档流中)之外,我还必须(手动)将新图像推送到fancybox的组中。
不是一个完美的解决方案,但它可以工作,请参见 DEMO
HERE
;您会在页面加载时看到三个缩略图。打开fancybox并导航到最后一项后,将在文档中添加另外三个缩略图,并在fancybox画廊中添加3个对应的图像。
还要注意,您必须
var done = false;在脚本开始时进行初始化。
顺便说一句,忘了功能
loadFancybox(),不需要。



