显示图片渐隐效果

图片渐隐效果(IE中有效):

1.Script代码:

<SCRIPT>
nereidFadeObjects = new Object();
nereidFadeTimers = new Object();
function nereidFade(object, destOp, rate, delta){
if (!document.all)
return
  if (object != "[object]"){ 
      setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
      return;
  }
     
  clearTimeout(nereidFadeTimers[object.sourceIndex]);
 
  diff = destOp-object.filters.alpha.opacity;
  direction = 1;
  if (object.filters.alpha.opacity > destOp){
      direction = -1;
  }
  delta=Math.min(direction*diff,delta);
  object.filters.alpha.opacity+=direction*delta;

  if (object.filters.alpha.opacity != destOp){
      nereidFadeObjects[object.sourceIndex]=object;
      nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
  }
}
</SCRIPT>

2.html代码:

<img src="http://www.google.com/images/logo_sm.gif" id="logo" border=0 style="FILTER: alpha(opacity=50)" onMouseOver=nereidFade(this,100,40,5) onMouseOut=nereidFade(this,30,40,5)>

3.可以自己测试一下效果,我这里就不显示了。

阅读更多
个人分类: Computer
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭