帮忙看看,检查好多次都发现不了问题
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery动画特效</title>
<script src="http://code.jquery.com/jquery-1.4.3.min.js"></script>
<style type="text/css">
div{
margin: 60px 60px;
position:absolute;
width:60px;
height:60px;
background-color:green;
border:solid 1px #ccc;
vertical-align:middle;
}
</style>
</head>
<body>
<input id="leftmove" type="button" value="左移"/>
<input id="rightmove" type="button" value="右移"/>
<br/>
<br/>
<div id="tip">我是div</div>
<script type="text/javascript">
$(function(){
var $time1=0;
var $time2=0;
$("#leftmove").bind("click",function{
$time1++;
$("#tip").animate({
left:"+=50px"},
3000,function(){
$("#tip").html("左移"+$time+"次");
})
});
$("rightmove").bind("click",function(){
$time2++;
$("#tip").animate({
left:"-=50px"},
3000,function(){
$("#tip").html("右移"+$time2+"次");
})
});
});
</script>
</body>
</html>