为什么运行不了
//问什么运行不了
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Untitled Document</title>
<style>
*{margin:0;padding:0}
#odiv{
width:200px;
height:200px;
left:0;
top:0;
position:relative;
opacity:0.1;
background:red;
filter:alpha(opacity:30);
opacity:0.3;
}
</style>
<script>
window.onload=function(){
var odiv=document.getElementById('odiv');
odiv.onmouseover=function(){
change(100);
}
odiv.onmouseout=function(){
change(10);
}
}
var timer=null;
var alph=30;
function change(target){
var odiv=document.getElementById('odiv');
clearInterval(timer);
var speed=10;
timer=setInterval(funcition(){
if(alph>target){
speed=-10;
}else{
speed=10;
}
if(alph==target){
clearInterval(timer);
}
else{
alph=alph+speed;
odiv.style.filter='alpha(opacity:'+alph+')';
odiv.style.opacity=alph/100;
}
},50);
}
</script>
</head>
<body>
<div id="odiv"></div>
</body>
</html>