window.onload?=?function(){
var?oDiv?=?document.getElementById('alpha');
oDiv.onmouseover?=?function(){
startChange(1);
};
oDiv.onmouseoout?=?function(){
startChange(0.3);
};
}
var?timer?=?null;
var?alpha?=?0.3;
function?startChange(target){
var?oDiv?=?document.getElementById('alpha');
clearInterval(timer);
timer?=?setInterval(function(){
var?speed?=?0;
if?(alpha?>?target)?{
speed?=?-0.03;
}?else?{
speed?=?0.03;
}
if?(alpha?==?target)?{
clearInterval(timer);
}?else?{
alpha?+=?speed;
oDiv.style.opacity?=?alpha;
}
},30)
}
2016-05-09
我已經(jīng)知道問(wèn)題在哪了。。。onmouseover多了個(gè)o?。。。。。?/p>