43、图片的水韵效果像

43、图片的水韵效果像

<html>

 

<head>

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<title>网页特效- 图片的水韵效果</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="images/flag.gif" 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>

 

Write a comment

Comments: 0