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

ID: Q213872


The information in this article applies to:


SUMMARY

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


MORE INFORMATION

WARNING: ANY USE BY YOU OF THE JAVA SCRIPT PROVIDED IN THIS ARTICLE IS AT YOUR OWN RISK. Microsoft provides this script "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose. This script is provided 'as is' and Microsoft does not guarantee that the following script can be used in all situations. Microsoft does not support modifications of the script to suit customer requirements for a particular purpose.

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()"> 

Additional query words: 98 front page FP2K fpscript


Keywords          : kbdta fpedit fpscript 
Version           : WINDOWS:
Platform          : WINDOWS 
Issue type        : kbinfo 

Last Reviewed: July 1, 1999