2007/02/27 | 飞舞的文字
类别(佳语心情) | 评论(0) | 阅读(6) | 发表于 04:24
<!--飞舞的文字-->
<div ID="theDiv_wlecome" align="center">
<script language="javascript">

function nextSize(i,incMethod,textLength)
{
if (incMethod == 1) return (42*Math.abs( Math.sin(i/(textLength/3.14))) );
if (incMethod == 2) return (125*Math.abs( Math.cos(i/(textLength/3.14))));
}

function sizeCycle(text,method,dis)
{
output = "";
for (i = 0; i < text.length; i++)
{
size = parseInt(nextSize(i +dis,method,text.length));
output += "<font style='font-size: "+ size +"pt'>" +text.substring(i,i+1)+ "</font>";
}
theDiv_wlecome.innerHTML = output;
}

function doWave(n)
{
theText = "Welcome You!!!";
sizeCycle(theText,1,n);
if (n > theText.length) {n=0}
setTimeout("doWave(" + (n+1) + ")", 100);
}
document.body.onload=doWave(0);
</script>
</div>

红色部分写上你要的文字就OK了


0

评论Comments