Title Bar Typist

Written by admin on December 26, 2008 – 7:25 am -

This script types a string or series of strings into the Title Bar.
Author: Jim Einarson (jim.einarson@ccra-adrc.gc.ca)

<!-- ONE STEP TO INSTALL TITLE BAR TYPIST:

  1.  Copy the coding into the HEAD of your HTML document  -->

<!-- STEP ONE: Paste this code into the HEAD of your HTML document  -->

<HEAD>

<SCRIPT LANGUAGE="JavaScript">

<!-- Begin
var message = new Array();
// Set your messages you want typed into the title bar below.
// To add more messages, just add more elements to the array.
message[0] = “This script will type out in your title bar over and over…”;
message[1] = “followed by whatever you type here…”;
message[2] = “and then, whatever you choose to type here…”;
message[3] = “and so on…”;
message[4] = “and so on…”;

// Set the number of repetitions (how many times a given message is typed out
// before moving onto the next message).
var reps = 1;
var speed = 275;// Set the overall typing speed (larger number = slower action).
var hold = 4 // set the length of time to display the whole phrase before retyping (larger number = longer)

// DO NOT EDIT BELOW THIS LINE.
var p = message.length;
var q = 0;
var r = 0;
var C = 0;
var mC = 0;
var s = 0;
var sT = null;

if (reps < 1) {
reps = 1;
}
function setMessage() {
typing = message[mC];
q = typing.length;
r = q + hold;
typeMessage();
}
function typeMessage() {
if (s > r) {
s = 0;
}
if (s > q) {
document.title = ‘|- ‘+ typing +’ - - -’;
}
else {
document.title = ‘|- ‘+ typing.substr(0,s)+’ - - -’;
}
if (C < (r * reps)) {
sT = setTimeout(”typeMessage()”, speed);
C++;
s++;
}
else {
C = 0;
s = 0;
mC++;
if(mC > p - 1) {mC = 0;}
sT = null;
setMessage();
   }
}
setMessage();
//  End –>
</script>

<!– Script Size:  2.01 KB –>

Tags:
Posted in Page Details |

Post a Comment