nereidFade.js
上传用户:jhtang88
上传日期:2014-01-27
资源大小:28528k
文件大小:1k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. // Flash Image Extension for Dreamwever ,by Yichun Yuan(dezone@sina.com)
  2. nereidFadeObjects = new Object();
  3. nereidFadeTimers = new Object();
  4. function nereidFade(object, destOp, rate, delta){
  5. if (!document.all)
  6. return
  7.     if (object != "[object]"){  //do this so I can take a string too
  8.         setTimeout("nereidFade("+object+","+destOp+","+rate+","+delta+")",0);
  9.         return;
  10.     }
  11.     clearTimeout(nereidFadeTimers[object.sourceIndex]);
  12.     diff = destOp-object.filters.alpha.opacity;
  13.     direction = 1;
  14.     if (object.filters.alpha.opacity > destOp){
  15.         direction = -1;
  16.     }
  17.     delta=Math.min(direction*diff,delta);
  18.     object.filters.alpha.opacity+=direction*delta;
  19.     if (object.filters.alpha.opacity != destOp){
  20.         nereidFadeObjects[object.sourceIndex]=object;
  21.         nereidFadeTimers[object.sourceIndex]=setTimeout("nereidFade(nereidFadeObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
  22.     }
  23. }