为什么不移动呢?是div初始定位问题吗?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery动画特效</title>
<script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.0/jquery.js"></script>
<style>
div{
position:absolute;
width:50px;
height:50px;
background:red;
top:50px;
left:200px;
}
</style>
</head>
<body>
<div>啊啊啊啊~</div>
<input id ='left' type = 'button' value='左移' />
<input id ='right' type = 'button' value='右移' />
</body>
<script>
$("#left").bind("click", function(){
$("div").animate({letf: "+= 50px"}, 300, function(){
$("div").html("啊啊啊我左移了~");
})
})
$("#right").bind("click", function(){
$("div").animate({left: "-= 50px"}, 300, function(){
$("div").html("啊啊啊我右移了~");
})
})
</script>
</html>