home *** CD-ROM | disk | FTP | other *** search
/ Internet Magazine 2003 July / INTERNET105.ISO / pc / software / windows / building / homesite / snippets / sample snippets / scroll message in status ba.hss < prev   
Encoding:
Text File  |  1998-10-11  |  1.4 KB  |  51 lines

  1.  
  2. <!-- Start Status scrolling, enter in Head tag -->
  3.     <SCRIPT LANGUAGE="JavaScript">
  4.  
  5.  
  6. var window_size = 0;
  7.  
  8. // These two lines make up the message that will be scrolled in the status
  9. // window
  10.  
  11. var Line1="\Put one message here!";
  12. var Line2="\Put second message here!";
  13.  
  14. function StartMarquee(initial_size) {
  15.               window_size = initial_size;
  16.               ScrolledMessage(window_size);
  17. }
  18.  
  19. function ScrolledMessage(scrollto) {
  20.               var StatusLine;
  21.               var msg = " ";
  22.               var i = 0;
  23. // "var speed" controls the scrolling speed
  24.               var speed = 90;
  25.  
  26. // Add your message here, seperated by whatever you'd like, enter the space bar for space instead of dots
  27.  
  28.               StatusLine = Line1+"..................."+Line2;
  29.  
  30.               scrollto--;
  31.               if (scrollto == -StatusLine.length)
  32.                      scrollto = window_size;
  33.  
  34.               if (scrollto > 0) {
  35.                      for (i=0; i<scrollto; i++)
  36.                             msg = " "+msg;
  37.                       msg = msg + StatusLine;
  38.                } else
  39.                       msg = StatusLine.substring(-scrollto, StatusLine.length);
  40.                msg = msg.substring(0,window_size);
  41.                window.status = msg;
  42.                window.setTimeout('ScrolledMessage('+scrollto+')', speed);
  43. }
  44.  
  45. </SCRIPT>
  46. <!-- End Status scrolling, enter in Head tag -->
  47.  
  48.  
  49.  
  50.  
  51.