繁体   English   中英

单击某个元素后,jQuery + Fancybox 停止工作

[英]jQuery + Fancybox stops working after click on a certain element

我在 /body 标签之前使用了这段代码:

 //// Opens links in FancyBox (loads only .entry-content)

    jQuery('.evcal_list_a, #events-mobile .evcal_list_a').fancybox({
    'width': '95%',
    'height': '95%',
    'type': 'ajax',
    'transitionOut': 'elastic',
    'transitionIn': 'elastic',
     'ajax': {
        dataFilter: function(data) {
            return jQuery(data).find('.entry-content')[0];
        }         
    }
});

正如你在这里看到的

如果您尝试单击任何事件图块,它们将在fancybox 中正确打开,但如果您单击下一个 (>) 或上一个 (<) 月箭头,它会加载该月的事件,并且fancybox 将不再打开用户到实际链接。

在此处输入图片说明

每次用户导航到不同的月份时,如何重新加载此 jQuery 脚本?

非常感谢!

因为您的 jquery 函数在页面加载后就完成了这项工作。

在更改月份时未执行 jquery。 因此没有fancybox。

解决方案:也为您的 jquery 添加触发器以进行月份更改。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM