首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

fade步骤

2012-10-07 
fade方法function fadeOut(steps){doFade.call(this,steps/10,1,false)}function fadeIn(steps){doFade.

fade方法

function fadeOut(steps){      doFade.call(this,steps/10,1,false);   };  function fadeIn(steps){      doFade.call(this,steps/10,0,true);    };  function doFade(steps,value,action,fn){      var ie=undefined!==window.ActiveXObject,calls=arguments.callee,t=this,step;value+=(action?1:-1)/steps,(action?value>1: value<0) && (value=action?1:0),ie===true ? t.style.filter='alpha(opacity='+value*100+')' : t.style.opacity=value;(action?value<1:value>0) && setTimeout(function(){calls.call(t,steps,value,action,fn);},1000/steps);(action?value===1:value===0 && 'undefined'!==typeof fn) && ('function'===typeof fn && fn.call(t)); }  

热点排行