程式碼如下:if (ele) { var v = ele.style.filter.replace("alpha(opacity=", "").replace(")", "") || ele.style.opacity; v var count = speed / 1000; var avg = count var timer = null; timer = setInterval(function() { if (v v = avg;
function fadeout(ele, opacity, speed) { if (ele) { var v = ele.style.filter.replace("alpha(opacity=", "").replace(")", "") || ele.style.opacity || 100 ; v var count = speed / 1000; var avg = (100 - opacity) / count; var timer = null;
timer = setInterval(function() { if (v - avg > opacity) { v -= avg;