我正在尝试从左侧为 div 设置动画。我正在学习网络上的一个教程,但由于某种原因,查询不起作用。我不明白为什么。查询有问题吗?
<%@ Page Language="C#" %>
<!DOCTYPE html>
<html>
<head>
<title>jquery practice page</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
$('#slideleft button').click(function() {
var $lefty = $(this).next();
$lefty.animate({
left: parseInt($lefty.css('left'), 10) == 0 ?
-$lefty.outerWidth() :
0
});
});
});
</script>
<style type="text/css">
.slide {
position: relative;
overflow: hidden;
height: 120px;
width: 350px;
margin: 1em 0;
background-color: #ffc;
border: 1px solid #999;
}
.slide .inner {
position: absolute;
left: 0;
bottom: 0;
width: 338px;
height: 36px;
padding: 6px;
background-color: #4c5;
color: #333;
}
#slidebottom .inner{
display:none;
}
.slide button {
margin: .7em 0 0 .7em;
}
</style>
</head>
<body>
<div id="slidebottom" class="slide">
<button>slide it</button>
<div class="inner">This is supposed to slide in from the left</div>
</div>
</body>
</html>
以上就是全部内容。我似乎无法找到错误。有人能帮我吗?