楽しいネットの新しいニュース

2541 ワード

   1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">  
   2. <HTML>  
   3.  <HEAD>  
   4.   <TITLE>    </TITLE>  
   5.   <script type="text/javascript">  
   6.     var dynamicMsg = null;  
   7.     function init() {  
   8.         dynamicMsg = new DynamicMessage(window.document.title, "【HI,  】", "【     】");  
   9.     }  
  10.   
  11.     function begin() {  
  12.         dynamicMsg.initIntervalMsg();  
  13.     }  
  14.   
  15.     function end() {  
  16.         dynamicMsg.clearIntervalMsg();  
  17.     }  
  18.   
  19.     /**  
  20.       *             
  21.       */  
  22.       function DynamicMessage(defaultMsg, msg, hiddenMsg) {  
  23.         this.initIntervalMsg = function() {  
  24.             this.intervalMsg = setInterval(function() {  
  25.                     if(!this.bMsg) {  
  26.                         window.document.title = msg + " - " + defaultMsg;  
  27.                         this.bMsg = true;  
  28.                     } else {  
  29.                         window.document.title = hiddenMsg + " - " + defaultMsg;  
  30.                         this.bMsg = false;  
  31.                     }         
  32.                 },   
  33.                 1000  
  34.               );  
  35.           };  
  36.             
  37.           this.clearIntervalMsg = function() {  
  38.             if(this.intervalMsg != null) {  
  39.                 clearInterval(this.intervalMsg);  
  40.                 window.document.title = defaultMsg;  
  41.                 this.bMsg = false;  
  42.             }  
  43.           };  
  44.       }  
  45.   </script>  
  46.  </HEAD>  
  47.  <BODY onload="init();">  
  48.     <center>  
  49.         <input type="button" value="begin" onclick="begin();"/>  
  50.         <input type="button" value="end" onclick="end();"/>  
  51.           
  52.   
  53.         coloryeah -        !  
  54.     </center>  
  55.  </BODY>  
  56. </HTML>