自己写的简单的渐隐渐现js方法

function FadeLimit(obj,start,end)
{
    
var _a;
    _a
=(start>end)?-5:5;
    
if(document.all){
        obj.style.filter
="alpha(opacity="+parseInt(start+_a)+")";    
    }
else
    
{
        obj.style.opacity
=parseInt(start+_a)/100;
    }

    
if(start==end){return;}
    window.setTimeout(
function(){
        FadeLimit(obj,start
+_a,end);
    }
,30);
}

/* 示例 */
FadeLimit(o,0,100);
posted @ 2008-05-26 22:53  mild  阅读(1310)  评论(0编辑  收藏  举报