JS控制图片水韵的渐现效果

发布时间:2011年1月10日 作者:未知 查看次数:2201

JS控制图片水韵的渐现效果


JS控制图片水韵的渐现效果

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>JS控制图片水韵的渐现效果</title>
</head>
<body onload="if (document.all)SmokeRing()">
<script language="JavaScript">
<!--
I=new Image();
I.src="sto/01.gif";
if (document.all){
document.write('<div id="C" style="position:absolute;top:0px;left:0px">');
document.write('<div style="position:relative">');
document.write('<img  id="pic" src="http://www.sieye.cn/./hShowpic/201091721291465.jpg" style="position:absolute;top:0px;left:0px">');
document.write('</div></div>');
}
S=null,fadeStep=4,fade=80,currentStep=0,step=2,RY=0,RX=0,Yarea=0,Xarea=0;
function Expand(){
if (document.all){
pic.width=currentStep*2;
pic.height=currentStep*2;
pic.style.top= -currentStep;
pic.style.left= -currentStep;
pic.style.filter='alpha(opacity='+fade+')';
currentStep+=step;
if (currentStep > 20) fade-=fadeStep;
if (fade < -50)
{
currentStep=0;
fade=80;
Yarea=window.document.body.clientHeight-80;
Xarea=window.document.body.clientWidth-80;
RY=Math.round(50+Math.random()*Yarea);
RX=Math.round(50+Math.random()*Xarea);
C.style.top=RY+document.body.scrollTop;
C.style.left=RX+document.body.scrollLeft;
}
S=setTimeout('Expand()',40);
}
}
if (document.all)window.onload=Expand;

if (document.layers)
 {
 alert("Your Browser is not capable of displaying this effect.\nPick another.");
 opener.gO();window.close();
 }
// -->
</script>
<div style="position:relative"></div>
</body>
</html>

 



版权所有!www.sieye.cn
E.Mail:sieye@sohu.com QQ:66697110