作者: William Lin (2007-03-13)
<!
DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"
>
<
html
>
<
head
>
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=gb2312"
>
<
title
>
无标题文档
</
title
>
<!--
top over
-->
<
script
language
="JavaScript"
>
...
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
>
</
head
>
<
body
>
<
a
href
="YourUrl.htm"
id
="img_2"
><
img
src
="AAA.jpg"
border
="0"
onMouseOut
=nereidFade(this,50,10,4)
onMouseOver
=nereidFade(this,100,10,4)
style
="FILTER: alpha(opacity=50)"
/>
</
body
>
</
html
>