Page Title Rotator
September 25th, 2008

This javascript allows you to rotate text messages in the title bar of your visitor’s browser. If they are using a modern browser that supports page tabs, the title will also be rotated there. If you use the Page Editor→†’Title,Meta Tags tab to enter a title for your page, it will remain valid for search engines. This script only alters the title after it is displayed in a browser.

Note: This script will not work on pages displayed in frames.

Place the following code in a custom header:

<script type="text/javascript">
// Original Programmed by Ira Sterbakov (irasterb@erols.com) 11/15/04
// Please keep credit in script
// May be freely used and modified
// Hosted at ACJavascript.com
 
var flipMsg = new Array();
var tt = 0;

// Time (in millisec) each message is displayed; adjust as needed
var delay = 750;
 
// Messages to be displayed in the title bar; add as many as you need
flipMsg[0] = "Hello";
flipMsg[1] = "SiteSpinner";
flipMsg[2] = "Users";
 
function flipTitle() {
  document.title = flipMsg[tt];
  tt = (tt < (flipMsg.length -1)) ? tt + 1 : 0;
  setTimeout('flipTitle()', delay);
}
</script>
<body onLoad="flipTitle();" />

There are two variables that you can modify:

delay This controls the amount of time any single message will remain in the title area. The value is expressed in milliseconds. The default is 750msec or 3/4-second.
flipMsg[] This is an array of messages, with each array element holding a single message. Array elements are numbered beginning at 0 and increasing by 1 for each additional message. There is no limit to the number of messages you may use, but too many messages will cause the effect to lose its appeal. Try to get your point across in as few messages as possible.


Leave a Reply

Spam protection by WP Captcha-Free


May 24th, 2012