IE浏览器 滤镜透明度问题
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>边距</title>
<style type="text/css">
*{margin:0;padding:0;}
#box1{
width:200px;
height:200px;
background:red;
filter:alpha(opacity:30);
opacity:0.3;
}
</style>
<script type="text/javascript">
window.onload=function(){
var oDiv = document.getElementById("box1");
oDiv.onmouseover = function(){
startMove(100);
}
oDiv.onmouseout = function(){
startMove(30);
}
}
var timer=null;
var alpha=30;
function startMove(itarget){
var speed=30;
var oDiv = document.getElementById("box1");
clearInterval(timer);
timer=setInterval(function(){
if (alpha>itarget){
speed = -10;
}
else{
speed = 10;
}
if(alpha == itarget){
clearInterval(timer);
}
else{
alpha+=speed;
oDiv.style.opacity=alpha/100;
oDiv.style.filter='alpha(opacity='+alpha+')';
}
},50);
}
</script>
</head>
<body>
<div id="box1"></div>
</body>
</html>
想知道oDiv.style.filter='alpha(opacity='+alpha+')';改变透明度这里为什么这么写'+alpha+'?alpha不是变量吗?应该可以直接等于alpha啊?