网页之奇特的文字变化特效
脚本说明:第一步:把如下代码加入<body>区域中.EH*Yo,MVGA
<script language="JavaScript">
,h,Q?0i+OCYt|
function nextSize(i,incMethod,textLength)2Nh'u4h a^q
{+P'Hh-H*d G
if (incMethod == 1) return (72*Math.abs( Math.sin(i/(textLength/3.14))) );
if (incMethod == 2) return (255*Math.abs( Math.cos(i/(textLength/3.14))));#t7e3x7h;W7i7d
}4w,[~'KKl*]^H$^
function sizeCycle(text,method,dis)
{
output = "";
for (i = 0; i < text.length; i++) C4M7\(i;Yp9Y2g N)Bn @
{Z,UuZ7c1P~ OLk5^
size = parseInt(nextSize(i +dis,method,text.length));#FVJu-e+N
output += "<font style='font-size: "+ size +"pt'>" +text.substring(i,i+1)+ "</font>";]a3YC%vB.Z3z&^t:]E
}
theDiv.innerHTML = output;;Q oT8?};X]
}
z$u$B{'FJ6}
function doWave(n)
{ z+zFD ~m
theText = "JavaScript";J~~5@C(J`Ty
sizeCycle(theText,1,n);K2ui.hCa%o
if (n > theText.length) {n=0}"e||.x*db*z;I
setTimeout("doWave(" + (n+1) + ")", 50);5RDbp0d
}
</script>q-JZrC.t(ty
<div ID="theDiv" align="center">
/mn!{'A&Z.X%q
</div>
}'Z;q8h2F'_u
GxF/R:L!Cn;hB
第二步:把如下代码加入<body>区域中<body onload=doWave(0);>
页:
[1]