实在是看不出哪里出错了,指点一下
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script src="http://libs.baidu.com/jquery/1.9.0/jquery.js" type="text/javascript"></script>
<title>jQuery动画特效</title>
<style type="text/css">
div{
width:40px;
height:40px;
margin:10px;
left:40px;
border:2px solid;
background:gray;
position:absolute;
}
</style>
</head>
<body>
<input type="button" value="左移" id="left"/>
<input type="button" value="右移" id="right"/>
<div></div>
<span></span>
<script type="test/javascript">
$(function(){
$("#left").bind("click",function(){
$("div").animate({
left:"+=10px"
},1000,function(){
$("span").html("左移了");
});
});
$("#right").bind("click",function(){
$("div").animate({
left:"-=10px"
},1000,function(){
$("span").html("右移了");
});
});
} );
</script>
</body>
</html>