设为首页 | 加入收藏
当前位置:首页>>网页特效>>状态栏特效>> 状态栏的字符有点冒泡的感觉

状态栏的字符有点冒泡的感觉

时间:2005-1-14 22:18:59 来源:本站收集整理 作者:佚名

要完成此效果需要两个步骤

第一步:把如下代码加入到<head>区域中

<script language="JavaScript">

  <!-- Funny text script by Bart Jellema
    var hellotext="欢迎光临"
    var thetext=""
    var started=false
    var step=0
    var times=1

    function welcometext()
    {
      times--
      if (times==0)
      {
        if (started==false)
        {
          started = true;
          window.status = hellotext;
          setTimeout("anim()",1);
        }
        thetext = hellotext;
      }
    }

    function showstatustext(txt)
    {
      thetext = txt;
      setTimeout("welcometext()",4000)
      times++
    }

    function anim()
    {
      step++
      if (step==7) {step=1}
      if (step==1) {window.status='>==='+thetext+'===<'}
      if (step==2) {window.status='=>=='+thetext+'==<='}
      if (step==3) {window.status='>=>='+thetext+'=<=<'}
      if (step==4) {window.status='=>=>'+thetext+'<=<='}
      if (step==5) {window.status='==>='+thetext+'=<=='}
      if (step==6) {window.status='===>'+thetext+'<==='}
      setTimeout("anim()",200);
    }
 

</script>


第二步:把“onLoad="welcometext()"”加在<body>标记里
例如:<body onLoad="welcometext()">