我遇到了一个问题,其中prettyPhoto和WordPress插件WPGYM的菜单发生冲突。 Chrome控制台的输出结果如下。
Uncaught TypeError: jQuery(...).prettyPhoto is not a function
at HTMLDocument.<anonymous> (script.js:3)
at i (jquery.js:2)
at Object.fireWith [as resolveWith] (jquery.js:2)
at Function.ready (jquery.js:2)
at HTMLDocument.K (jquery.js:2)
根据这些信息,我已经从script.js跟踪了这一行的问题: -
jQuery(".gallery-icon a").prettyPhoto({animationSpeed:'normal',theme:'light_square', show_title : false}); jQuery("a[rel^='prettyPhoto'], .gallery-icon a").prettyPhoto({animationSpeed:'normal',theme:'light_square', show_title : false});
由于我对Jquery并不熟悉,因此我不确定如何解决此问题。如果有人能指出我正确的方向,那将非常感激。