0

我在使用通过无限滚动拉入的内容上的自定义关闭按钮关闭 Fancybox 时遇到问题。

http://fancyapps.com/fancybox/

http://www.infinite-scroll.com/

无限滚动之前页面上包含的所有内容都可以正常打开和关闭。对于通过无限滚动拉入的内容,我可以毫无问题地启动 Fancybox,但是单击关闭后,我只是将备份扔到页面顶部并且 Fancybox 永远不会关闭。

这是我正在使用的代码:

HTML

<a href="#" class="fncy-custom-close">
    <span>Close</span>
</a>

JS

$(document).ready(function() {
    $('.fancybox').fancybox({
        padding : 0,
        scrolling : 'no',
        arrows : false,
        closeBtn : false,
        helpers : {
            overlay: {
                opacity: 0.6
            }
        }
    });
    $('a.fncy-custom-close').click(function(e){
        e.preventDefault();
        $.fancybox.close();
    });
});

任何帮助是极大的赞赏。谢谢。

4

1 回答 1

0

This may have been a bug in the plugin, as it seems to have resolved itself. All is good now!

于 2012-09-05T02:32:29.090 回答