怎么回事,为什么我的只能左移不能右移?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css">
#divtest
{
position:absolute;
top:50px;
left:200px;
background:blue;
width:80px;
height:80px;
}
#divtest2
{
position:absolute;
top:150px;
left:150px;
}
</style>
<title>jQuery动画特效</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
</head>
<body>
<input type="button" id="buttontest0" value="左移"/>
<input type="button" id="buttontest1" value="右移"/>
<div id="divtest"></div>
<div id="divtest2">等待点击</div>
<script>
$("#buttontest0").bind("click",function(){
$("#divtest").animate({
left:"-=50px"
},200,function(){
$("#divtest2").html("左移完成!");
})
});
$("buttontest1").bind("click",function(){
$("#divtest").animate({
left:"+=50px"
},200,function(){
$("#divtest2").html("右移完成!");
})
});
</script>
</body>
</html>