代码哪里有问题吗?为什么运行没有动画效果呢?
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>jQuery动画特效</title>
<style type="text/css">
div{
position:absolute;
top:50px;
left:200px;
height:50px;
width:50px;
border:1px solid red;
}
</style>
</head>
<body>
<div></div>
<input type="button" value="左移" id="l1">
<input type="button" value="右移" id="r1">
<script type="javascript/text">
var $ltime=0;
var $rtime=0;
$(function(){
$("#l1").bind("click",function(){
$ltime++;
$("div").animate({
left:"-=50px";
},3000,function(){
$("div").html("左移"+$ltime+"次")
})
})
$("#r1").bind("click",function(){
$rtime++;
$("div").animate({
left:"+=50px";
},3000,function(){
$("div").html("右移"+$rtime+"次")
})
})
});
</script>
</body>
</html>