运行了没有反应,请问哪里出了问题?
<!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>无标题文档</title>
<style style="text/css">
*{padding:0;margin:0;}
#tmd{width:300px;height:300px;
background:green;
filter:alpha(opacity:30);
opacity:0.3;
}
</style>
<script>
window.onload=function(){
var adiv=document.getElementById("tmd");
adiv.onmouseover=function(){startmove(100);}
adiv.onmouseout=function(){startmove(30)}}
var timer=null,
var alpha=30;
function startmove(itarget){
var adiv=document.getElementById("tmd");
clearInterval(timer);
timer=setInterval(function(){
var speed=0
if (alpha>itarget){
var speed = -10
}
else{
var speed = 10
}
if (alpha == itarget) {
clearInterval(timer)
}
else
{alpha =alpha+speed;
adiv.style.filter='alpha(opacity:+"alpha"+)';
adiv.style.opacity=alpha/100;
}
},30)
}
</script>
</head>
<div id="tmd"></div>
<body>
</body>
</html>