求救呀不知道哪里錯(cuò)了
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>無(wú)標(biāo)題文檔</title>
<style>
*{padding:0;margin:0;}
#tmd{width:300px;height:300px;
? ? ?background:green;
filter:alpha(opacity:30);
opacity:0.3;
}
</style>
<script>
window.onload=function(){
var odiv=document.getElementById('tmd');
odiv.onmouseover=function(){move(100);}
odiv.onmouseout=function(){move(30);}
}
var time=null,
? ?TM=30;
?
function move(itarget){
var odiv=document.getElementById('tmd');
?clearInterval(time);
? time=setInterval(function(){
var speed=0;
?if(TM<itarget){
?speed=10;
?}else{speed=-10;}
?if(TM=itarget){clearInterval(time)}else{
?TM=TM+speed;
?odiv.style.filter='alpha(opacity:'+TM+')';
?odiv.style.opacity= TM/100;
? }
?},30)
}
</script>
</head>
<div id="tmd"></div>
<body>
</body>
</html>