Bookmark and Share

Lee's 程序人生

HTML CSS Javascript XML AJAX ATLAS C# C++ 数据结构 软件工程 设计模式 asp.net Java 数字图象处理 Sql 数据库
  博客园  :: 首页  :: 新随笔  :: 联系 :: 管理

鼠标移过图片变清晰效果

Posted on 2008-06-13 10:58  analyzer  阅读(279)  评论(0编辑  收藏  举报
<IMG onmouseover=nereidFade(this,100,3,5) style="FILTER: alpha(opacity=55)" onmouseout=nereidFade(this,50,3,5) alt=懒人图库 src="http://www.makewing.com/lanren/jscode/js-0053/images/b-04.jpg" border=0>   
<script language=JavaScript>     
nereidFadeObjects 
= new Object();    
nereidFadeTimers 
= new Object();    
function nereidFade(object, destOp, rate, delta){    
if (!document.all)    
return    
    
if (object != "[object]"){  //do this so I can take a string too    
        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>   
我要啦免费统计