当前位置:首页 > 网页特效 > 文字特效 >

闪烁文字特效和随机图片代码

时间:2014-06-08 00:06 来源:互联网 作者:源码搜藏 收藏 推荐

运行代码 保存代码 复制代码 提示:您可以先修改部分代码再运行,保存代码功能在Firefox下无效。
  • 闪烁文字特效和随机图片代码

    一个闪动文字特效和随机显示图片的JS代码,页面打开文字跳动闪烁,图片随机调用显示,每天打开都不一样哦!
  •       <SCRIPT language=JavaScript>
     
    function nextSize(i,incMethod,textLength)
    {
    if (incMethod == 1) return (32*Math.abs( Math.sin(i/(textLength/3.14))) );
    if (incMethod == 2) return (255*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.innerHTML = output;
    }
     
    function doWave(n) 
    {   
    theText = "===祝你马年大喜!万事如意!===";
    sizeCycle(theText,1,n);
    if (n > theText.length) {n=0}
    setTimeout("doWave(" + (n+1) + ")", 50);
    }
    </SCRIPT>
由源码搜藏网整理,转载请注明出处https://www.codesocang.com/tx-wenzi/8545.html

文字特效下载排行

最新文章