jQuery 和 Wordpress 未捕获到类型错误? [英] Uncaught TypeError with jQuery and Wordpress?
问题描述
我在我的 wordpress 网站上遇到问题,我的 nivo 滑块无法加载横幅图像并显示它们.
I am having trouble on my wordpress site, my nivo slider will not load the banner images and display them.
我很确定这与在其他地方加载的 jquery 有关,但我不知道.
I'm pretty sure its to do with jquery been loaded somewhere else, but i just dont know.
有人可以看看我的网站吗,css-signs.ie并检查错误
Could some one look at my website, css-signs.ie and inspect the error
这里是错误
Uncaught TypeError: Property '$' of object [object DOMWindow] is not a function
推荐答案
美元符号不是页面上 jQuery 的别名.使用 jQuery 就绪函数将 jquery.nivo.slider.js 中第 467 行开始的代码块包装起来,将 '$' 设置为函数块中的别名,如下所示:
The dollar sign is not an alias for jQuery on your page. Wrap the code block starting at line 467 in jquery.nivo.slider.js with a jQuery ready function setting the '$' as an alias within the function block, like this:
jQuery(function($) {
$(window).load(function() {
$('#sliderNivo').nivoSlider({
effect:$nivo_slider_effect,
slices:15,
animSpeed:500,
pauseTime:$nivo_slider_speed,
keyboardNav:false,
pauseOnHover:true
});
});
});
查看有关将 jQuery 与其他库结合使用的更多信息.
这篇关于jQuery 和 Wordpress 未捕获到类型错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!