为什么点击按钮没效果
<!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>
<style type="text/css">
*{
margin:0;
padding:0;
}
div{
width:50px;
height:50px;
background:black;
margin:100px;
position:absolute;
}
button{
width:45px;
margin:20px;
}
</style>
</head>
<body>
<button id="btn1">左移</button>
<button id="btn2">右移</button>
<div></div>
<script>
$(function(){
$('#btn1').bind('click', function(){
$('div').animate({
left:'-=50px';
}, 3000)
});
$('#btn2').bind('click', function(){
$('div').animate({
left:'+=50px';
}, 3000);
}
})
</script>
</body>
</html>