FP2000: How to Create a Scrolling Message in Browser's Status Bar (213872)



The information in this article applies to:

  • Microsoft FrontPage 2000

This article was previously published under Q213872

For a Microsoft FrontPage 98 version of this article, see 194155.
For a Microsoft FrontPage 97 version of this article, see 167596.

SUMMARY

This article provides a sample FrontPage Java script that displays a custom, scrolling message in the Internet Explorer status bar.

MORE INFORMATION

Microsoft provides programming examples for illustration only, without warranty either expressed or implied. This includes, but is not limited to, the implied warranties of merchantability or fitness for a particular purpose. This article assumes that you are familiar with the programming language that is being demonstrated and with the tools that are used to create and to debug procedures. Microsoft support engineers can help explain the functionality of a particular procedure, but they will not modify these examples to provide added functionality or construct procedures to meet your specific requirements.

Example

Insert the following script in the
<head>
section of your HTML Web page:
  <script Language="JavaScript">
 	// Scrolling text string.
	var strText="This is a scrolling message!"; 
	// Length of the text
	var intText=strText.length; 
	// Speed of the scroll 
	var intSpeed=25; 
	// Width of the scrolling area.
	var intWidth=100; 
	var intPos=1-intWidth;
         function scroll()
         {
           // Initialize the string to be printed.
           intPos++;
           var strScroll="";
           // Move to the right in the string.
           if (intPos==intText)
           {
             // Start over if the string is done.
             intPos=1-intWidth;
           }
           // Scrolling
           if (intPos<0)
           {
           // Add spaces to beginning if necessary.
			 for (var i=1; i<=Math.abs(intPos); i++)
             {
               strScroll=strScroll+" ";
             }
             strScroll=strScroll+strText.substring(0, intWidth-i+1);
           }
           else
           {
           strScroll=strScroll+strText.substring(intPos,intWidth+intPos);
           }
           window.status = strScroll;
           setTimeout("scroll()", intSpeed);
         }
 </script>
				
In order for the message to function, modify the <BODY> tag so that it looks like this:
<BODY onload="scroll()">
				

Modification Type:MajorLast Reviewed:6/18/2005
Keywords:kbinfo KB213872