各位大神,求帮忙看看哪里错了!!谢谢!
各位大神,求帮忙看看哪里错了!!谢谢!
<!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">
div{
width:100px;
height:100px;
background-color:red;
position:relative;
margin:20px 0 0 100px;
}
</style>
</head>
<body>
<input id="btnl" type="button" value="左移">
<input id="btnr" type="button" value="右移">
<div></div>
<script type="text/javascript">
$(function(){
$("#btnl").bind("click",function(){
$("div").animate({
left: "-=50px"
},2000,function({
$("div").html("左移完成");
})
);
});
$("#btnr").bind("click",function(){
$("div").animate({
left: "+=50px"
},2000,function({
$("div").html("右移完成");
})
);
});
});
</script>
</body>
</html>