为什么鼠标移上去没效果啊
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<style type="text/css">
*{
padding:0px;
margin:0px;
}
#sqr{
width:200px;
height:200px;
background:red;
filter:alpha(opacity:30);
opacity:0.3;
}
</style>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>透明度</title>
<script>
window.onload=function(){
var dd=document.getElementById("sqr");
dd.onmouseover=function(){
startmove();
}
var a=null;
var alpha=30;
function startmove(){
var dd=document.getElementById("sqr");
clearInterval(a);
a=setInterval(function(){
if(alpha==100)
{ clearInterval(a);}
else{
alpha=alpha+10;
dd.style.filter="alpha(opacity:"+alpha+")";
dd.style.opacity=alpha/100;
}
},30)
}
</script>
</head>
<body>
<div id="sqr">
</div>
</body>
</html>