fancybox与Slider pro的兼容性

时间:2019-02-04 19:00:15

标签: jquery fancybox-3

我遇到了fancybox和Slider Pro之间的兼容性问题,该插件用于在我的网站上可视化视频。

fancybox的Java代码中存在此错误:

89 Uncaught TypeError: jQuery(...).fancyboxforwp is not a function
at HTMLDocument.<anonymous> ((index):89)
at i (jquery.js?ver=1.12.4:2)
at Object.fireWith [as resolveWith] (jquery.js?ver=1.12.4:2)
at Function.ready (jquery.js?ver=1.12.4:2)
at HTMLDocument.K (jquery.js?ver=1.12.4:2)

出现在我的wordpress的几页中,当fancybox处于打开状态时,它会阻止我的Slider Pro插件显示和工作。

是否有可能在fancybox中修复此错误?

最好, 愤怒

2 个答案:

答案 0 :(得分:0)

查看错误消息-

jQuery(...).fancyboxforwp is not a function

因此,某事正在尝试做类似$('.some-selector').fancyboxforwp()的事情,但是$.fn.fancyboxforwp方法不存在,结果是此错误消息。

基本上,您的问题根本与fancybox无关。我不知道fancyboxforwp是什么,也许它是由您当前主题的作者或某些插件创建的,您应该自己检查一下。

答案 1 :(得分:0)

/wp-content/plugins/fancybox-for-wordpress/fancybox.php

寻找:

wp_register_script( 'fancybox', FBFW_URL . 'assets/js/jquery.fancybox.js', $jquery, '1.3.4', $footer ); 

用定义了1.3.4的正确版本替换'assets/js/jquery.fancybox.js'