问题遇到的现象和发生背景
代码别人运行没有问题,我自己运行不知道为什么click毫无反应,不知道哪里有问题。
是在这之前需要做什么配置才会出现动画的效果吗?
用代码块功能插入代码,请勿粘贴截图
<!DOCTYPE html>
<html>
<head>
<title>Showing and Hiding Elements</title>
<link rel="stylesheet" href="style.css" />
<script type="text/javascript" src= "https://code.jquery.com/ui/1.10.4/jquery-ui.js"></script>
<script type="text/javascript">
$(function() {
$("#show").click(function() {
$("#theDiv").show(2000,"swing",function(){
$(this).text("hello")
$("#theDiv").hide(1000,function(){
$("#theDiv").show(1000,function(){
$(this).text("Hello")
})
})
})
});
$("#hide").click(function() {
$("#theDiv").hide(200,function(){
$(".abc").text("hide")
})
});
$("#toggle").click(function() {
$("#theDiv").toggle("slow",completion);
});
});
function completion(){
$(this).text("Animation complete");}
</script>
<style type="text/css">
p,
span {
font-size: 16pt;
}
button {
margin: 5pt 5pt 0 0;
}
</style>
</head>
<body>
<h1>Using the show and hide effects</h1>
<div id="content">
<p>How r u.</p>
<ul>
<li><code>show()</code>: Reveals the matched elements using an optional animation</li>
<li><code>hide()</code>: Hides the matched elements using an optional animation</li>
<li><code>toggle()</code>: Toggles the visible state of the matched elements using an optional animation</li>
</ul>
<div id="theDiv" class="box">
</div>
<button id="show">Show</button>
<button id="hide">Hide</button>
<button id="toggle">Toggle</button>
</div>
<div class="abc">abc</div>
</body>
</html>
运行结果及报错内容
我想要达到的结果
成功做出动画效果,可以hide也可以show