狀態列跑馬燈方式顯示訊息

摘要:狀態列跑馬燈方式顯示訊息

<script   Language="JavaScript">  
          var   interval=100;  
          var   spacelen=120;  
          var   space10="   ";  
          var   seq=0;  
          function   Scroll(msg)
          {  
              len=msg.length;  
              window.status=msg.substring(0,seq+1);  
              seq++;  
                      if(seq>=len)  
                                            {  
                                                 seq=spacelen;  
                                               window.status=msg.substring(0,seq+1); 
                                                }  
                      else  
                                                window.setTimeout("Scroll2('"+msg+"');",interval);   
             }   
          function   Scroll2(msg)
            {  
                        var   out="";  
                        for(i=1;i<=spacelen/space10.length;i++)out+=space10;  
                        out=out+msg;  
                        len=out.length;  
                        window.status=out.substring(seq,len);  
                        seq++;  
                        if(seq>=len){seq=0;};  
                        window.setTimeout("Scroll2('"+msg+"');",interval);   
                }   
        </script>
 
 Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
 Dim CSM As ClientScriptManager = Page.ClientScript
CSM.RegisterClientScriptBlock(Me.GetType(), "", "<script>Scroll('**注意:15分鐘內至少儲存資料一次,避免資料流失。**')</" & "script>")
End Sub