16.2.11 status属性.html

来自「即学即用JavaScript核心对象参考手册原版光盘」· HTML 代码 · 共 38 行

HTML
38
字号
<body onLoad="toScroll()">  
<script>
    var sMsg="window对象的status属性演示" 
    var pos=1; 
	document.write(sMsg);
	//在装填栏上依次增加字符
    function toScroll() 
	{ 
        window.status=sMsg.substring(0, pos); 
        if (pos >= sMsg.length) 
		{ 
            pos=1; 
            window.setTimeout("Scroll()",300); 
         } 
		 else
	     { 
             pos++; 
             window.setTimeout("toScroll()",50); 
          } 
     } 
	 //在状态栏上逐渐减少字符
     function Scroll() 
	 { 
        window.status=sMsg.substring(pos, sMsg.length); 
        if (pos >= sMsg.length) 
		  { 
              pos=1; 
              window.setTimeout("toScroll()", 100); 
          } 
		else
	     { 
             pos++; 
             window.setTimeout("Scroll()", 50); 
          } 
      } 
</script>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?