日期:2014-05-17 浏览次数:20735 次
var value = 100; var oImg = document.getElementsByTagName("img")[0]; oImg .opacityVlaue = 0; if(oImg .iTimer) clearInterval(oImg.iTimer); oImg.iTimer = setInterval(function(){ if(oImg .opacityVlaue < 100) { oImg .opacityVlaue += 10; oImg.style["filter"] = "alpha(opacity:"+oImg .opacityVlaue+")"; oImg.style["opacity"] = oImg .opacityVlaue/ 100; } else { clearInterval(oImg.iTimer); oImg.iTimer = 0; oImg .opacityVlaue = 100; oImg.style["filter"] = "alpha(opacity:"+oImg .opacityVlaue+")"; oImg.style["opacity"] = oImg .opacityVlaue/ 100; } } , 30)