Code Snippets

  

JavaScript Source Code



Status Bar Statements

Use this script to place static, multi-line text the status bar of your website

Submitted By: AGRAC393
Actions:
Rating:
Views: 763

Language: JavaScript

Last Modified: February 8, 2010
Instructions: All you need to do is place this script in the root of the server, replace with text with yours and call the function. Then you have a sweet little piece of candy for your website! Read comment lines for instructions.

Snippet


  1. var line1 = "Thank you for visiting my site!"; //Set your first line here as line1.
  2. var speed = 3000; //Set the speed you wish them to change. This is 3 seconds, base 1000.
  3. var loopEnter = 1; // Set a loopEntrance var. This can be anything.
  4. function disp() // disp is the display function name.
  5. {
  6.   if (loopEnter == 1) //Logical operation
  7.     {
  8.       window.status=line1; //Display what is in the line1 var.
  9.       loopEnter=0; //Set loopEnter to 0.
  10.     } 
  11.   else
  12.     {
  13.       window.status="Contact us for any questions"; //Default text.
  14.       loopEnter=1; // Set loopEnter back to 1
  15.     }
  16.   setTimeout("disp();",speed); // wait for speed and "disp" is ready to be used in an html file
  17. }

Copy & Paste


Comments

There are currently no comments for this snippet. Be the first to comment!

Add comment


You must be registered and logged on to </dream.in.code> to leave comments.