gpt4 book ai didi

javascript - 未捕获的类型错误 : Object [object Object] has no method 'slides'

转载 作者:行者123 更新时间:2023-11-28 21:03:30 24 4
gpt4 key购买 nike

当我在 header.php 文件中添加以下脚本时,我遇到了这个问题。

<script type="text/javascript">
$(function() {
$("#logo a span").css("opacity","0");
$("#logo a span").hover(function () {
$(this).stop().animate({
opacity: 1
}, 'slow');
},
function() {
// animate opacity to nill
$(this).stop().animate({
opacity: 0
}, 'slow');
});
});
</script>

在“/head”之前我添加了这段代码

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>

当我打开页面时,无法加载幻灯片,并且我的 General.js 中存在一些错误。

Uncaught TypeError: Object [object Object] has no method 'prettyPhoto'
$.fn.superfish.sfgeneral.js:92
f.Callbacks.njquery.js:2
f.Callbacks.o.fireWithjquery.js:2
e.extend.readyjquery.js:2
c.addEventListener.B

Uncaught TypeError: Object [object Object] has no method 'slides'
$.fn.superfish.sfgeneral.js:45
f.event.dispatchjquery.js:3
f.event.add.h.handle.i

我的 web 目录中还有一个 jquery.js,但上面的这些错误描述都在该文件中。

这个问题我找了好几天了,还是没找到解决办法。任何帮助将不胜感激。

最佳答案

您没有引用 prettyPhotojQuery 插件。

prettyPhoto 不是 jQuery 核心函数中的函数,您需要使用使用该函数扩展 jQuery 的“库”。

您应该在 jQuery 核心库之后添加对插件的引用:

<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="{prettyPhoto location}"></script>

顺便说一句,引发错误的代码不在您粘贴到此处的代码中......

关于javascript - 未捕获的类型错误 : Object [object Object] has no method 'slides' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10442014/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com