左移,右移 简单动画,问题,,,,,, 我就想知道我哪儿错了? 没效果!
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery动画特效</title>
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
</head>
<style>
div{
width:100px;
height:100px;
background:#b00;
position:relative;
left:100px;
top:100px;
}
</style>
<body>
<input type=button value="向左" id="left"/>
<input type=button value="向右" id="right"/>
<div></div>
<script>
$(function(){
$("#left").blind("click",function(){
$("div").animate({
left:"-=100"
},1000,function(){
$(this).html("左移")
})
})
$("#right").blind("click",function(){
$("div").animate({
left:"+=100"
},1000,function(){
$(this).html("右移")
})
})
})
</script>
</body>
</html>