gpt4 book ai didi

javascript - (Object object) 没有方法效果

转载 作者:行者123 更新时间:2023-11-30 17:55:06 24 4
gpt4 key购买 nike

我似乎无法理解代码有什么问题。我添加了 jquery 和 jquery UI 仍然有:[objec object] has no method effect 错误

这是html代码:

<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>title</title>
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.2.min.js">
</script>
<script type="text/javascript" src = 'script.js'></script>
</head>

<body>
<div id = 'container'>
<div id ='one' class = 'inside'>1</div>
<div id ='two' class = 'inside'>2</div>
<div id ='three' class = 'inside'>3</div>
<div id ='four'class = 'inside'>4</div>
<div id ='five' class = 'inside'>5</div>
</div>
</body>
</html>

和 javascript 代码:

$(document).ready( function () {
alert('JQ on');

$('.inside').mouseover(function () {
$(this).fadeTo(1000,1);
});

$('.inside').mouseleave(function () {
$(this).fadeTo(500,0.2);
})

$('.inside').click(function () {
$(this).effect('explode');
})
})

有什么想法吗?

最佳答案

您已经包括了 jQuery UI 样式表,但没有包括它的 JavaScript。

你需要添加:

<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>

(或提供它的另一个 URI)在包含 jQuery JS 之后。

关于javascript - (Object object) 没有方法效果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18206059/

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