Javascripts > Misc Javascripts > Title Changer
Script Title: Title Changer
Description: Title Changer is a script which takes and array and places it in the title. To clear the array it "sweeps" it away and then sweeps it back through. It is fairly customizable and easy to use
Example: No example available for this script.
Copy the following code into your <HEAD></HEAD> tags.<script type = "text/javascript" language = "Javascript"> <!-- Hide from older browsers; /*======================================================= ========================================================= Title Changer Script ========================================================= ========================================================= START INTACT MATERIAL ========================================================= Title Changer Ver 1.0 Nick Knudson (c) 2006 http://nickrules.freesuperhost.com This script may be used free of charge as long as the parts between the two markers (INTACT MATERIAL)remains unchanged. Title changer is a script that randomly changes the title into patterns or flashes information. To download this script and other please visit my website at http://nickrules.freesuperhost.com Version history contained within README file distributed with download. If you do not have the README file odds are this version is incomplete or modified. For a full copmlete copy of this script download this script free at: http://nickrules.freesuperhost.com/downloads/ ========================================================= END INTACT MATERIAL =======================================================*/ //MODIFY THESE VARIABLES: // Set the overall speed (larger number = slower action). //Note: time is in milliseconds //Note: 1000ms to 1sec var speed = 250; //What you want the "wiper bar" to look like? var H = "||"; //What you want the ends of the bar to look like? var E = "[---]"; //What you want the space filler to look like? var S = "="; //set messages var message = new Array(); //Do not make longer than 30 spaces... length of this marker //All messages are forced into uppercase //Marker-----|--------------30--------------| // | | // | | message[1] = "Message 1 can only go to here"; message[2] = "MESSAGE 2 CAN ONLY GO TO HERE"; message[3] = "DO YOU GET THE POINT YET?"; message[4] = "If the message goes way out to here then youll get an error"; message[5] = ""; message[6] = ""; message[7] = ""; message[8] = ""; message[9] = ""; //How many different arrays did you enter? var num = "5"; //================================ //DO NOT EDIT BELOW THIS POINT --- //================================ //VARIABLES var pat = 0; //patter number var p = message.length; //length of selected array var mC = 1; //number of array var st = null; //setTimeout var K = message[mC]; //orig message var L = ""; //Uppercase message var M = ""; //message padded with fillers var N = ""; //mess: spaces replaced with fillers var X = ""; //message covered var Y = ""; //message revealed var leng = K.length; //length of array again var xmess = 0; //revealed numbers in x substr start (++) var xmess2 = 1; //revealed numbers in x substr end (++) var ymess = 29; //revealed numbers in y substr start (--) var ymess2 = 30; //revealed number in y substr end (--) var xmessstart = ""; //x message on left side of wiper var ymessstart = ""; //y message on left side of wiper var xmessend = ""; //x message on right side of wiper var ymessend = ""; //y message on right side of wiper var thingy = H; //second variable for the wiper var rpt = ""; //number until pattern is reset //below: the blank line full of fillers var V = S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+S; function runMe() { howLongAmI(); } function dontRunMe() { clearTimeout(st); document.title = "There was a problem with TitleChange"; speed = 100000; } function changeMe() { K = message[mC]; leng = K.length; runMe(); } function pattern() { if (pat == 1) { document.title = ""+E+""+S+""+S+""+S+""+V+""+S+""+S+""+H+""+E+""; } if (pat == 2) { document.title = ""+E+""+S+""+S+""+S+""+V+""+S+""+H+""+S+""+E+""; } if (pat == 3) { document.title = ""+E+""+S+""+S+""+S+""+V+""+H+""+S+""+S+""+E+""; } if (pat > 3 && pat < 34) { document.title = ""+E+""+S+""+S+""+S+""+Y+""+S+""+S+""+S+""+E+""; ymess--; ymess2--; } if (pat == 34) { document.title = ""+E+""+S+""+S+""+H+""+N+""+S+""+S+""+S+""+E+""; } if (pat == 35) { document.title = ""+E+""+S+""+H+""+S+""+N+""+S+""+S+""+S+""+E+""; } if (pat == 36) { document.title = ""+E+""+H+""+S+""+S+""+N+""+S+""+S+""+S+""+E+""; } if (pat == 37) { document.title = ""+E+""+S+""+H+""+S+""+N+""+S+""+S+""+S+""+E+""; } if (pat == 38) { document.title = ""+E+""+S+""+S+""+H+""+N+""+S+""+S+""+S+""+E+""; } if (pat > 38 && pat < 69) { document.title = ""+E+""+S+""+S+""+S+""+X+""+S+""+S+""+S+""+E+""; xmess++; xmess2++; } if (pat == 69) { document.title = ""+E+""+S+""+S+""+S+""+V+""+H+""+S+""+S+""+E+""; } if (pat == 70) { document.title = ""+E+""+S+""+S+""+S+""+V+""+S+""+H+""+S+""+E+"";} if (pat < 70) { st = setTimeout("pattern(); displayMeX(); displayMeY();", speed); pat++; } else { pat = 0; xmess = 0; xmess2 = 1; ymess = 29; ymess2 = 30; mC++; if(mC > num - 1) { mC = 0; } st = null; changeMe(); } } function howLongAmI() { if (leng > 30) { alert("Message["+mC+"] is longer than 30 characters.\nPlease edit the script so that the message is\nless than 30 characters. THANK YOU!!"); dontRunMe(); } if (leng < 31) { L = K.toUpperCase(); padMePlease(); } } function padMePlease() { if (leng == 1) { M = S+S+S+S+S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S+S+S+S+S; } if (leng == 2) { M = S+S+S+S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S+S+S+S+S; } if (leng == 3) { M = S+S+S+S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S+S+S+S; } if (leng == 4) { M = S+S+S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S+S+S+S; } if (leng == 5) { M = S+S+S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S+S+S; } if (leng == 6) { M = S+S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S+S+S; } if (leng == 7) { M = S+S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S+S; } if (leng == 8) { M = S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S+S; } if (leng == 9) { M = S+S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S; } if (leng == 10) { M = S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S+S; } if (leng == 11) { M = S+S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S; } if (leng == 12) { M = S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S+S; } if (leng == 13) { M = S+S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S; } if (leng == 14) { M = S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S+S; } if (leng == 15) { M = S+S+S+S+S+S+S+S+L+S+S+S+S+S+S+S; } if (leng == 16) { M = S+S+S+S+S+S+S+L+S+S+S+S+S+S+S; } if (leng == 17) { M = S+S+S+S+S+S+S+L+S+S+S+S+S+S; } if (leng == 18) { M = S+S+S+S+S+S+L+S+S+S+S+S+S; } if (leng == 19) { M = S+S+S+S+S+S+L+S+S+S+S+S; } if (leng == 20) { M = S+S+S+S+S+L+S+S+S+S+S; } if (leng == 21) { M = S+S+S+S+S+L+S+S+S+S; } if (leng == 22) { M = S+S+S+S+L+S+S+S+S; } if (leng == 23) { M = S+S+S+S+L+S+S+S; } if (leng == 24) { M = S+S+S+L+S+S+S; } if (leng == 25) { M = S+S+S+L+S+S; } if (leng == 26) { M = S+S+L+S+S; } if (leng == 27) { M = S+S+L+S; } if (leng == 28) { M = S+L+S; } if (leng == 29) { M = S+L; } if (leng == 30) { M = L; } fillMeUp(); } function fillMeUp() { N = M.replace(/ /g, ""+S+""); pattern(); } function displayMeX() { xmessstart = V.substring(0, xmess); xmessend = N.substring(xmess2, 30); X = xmessstart + thingy + xmessend; if (xmess > 30) { xmess = 0; } if (xmess2 > 31) { xmess2 = 1; } } function displayMeY() { ymessstart = V.substring(0, ymess); ymessend = N.substring(ymess2, 30); Y = ymessstart + thingy + ymessend; if (ymess < 0) { ymess = 29; } if (ymess2 < 1) { ymess2 = 30; } } /*======================================================= ========================================================= END Title changer script ========================================================= =======================================================*/ // end hide --> </script>
Copy the following code INTO your <BODY> tag.<body onload="runMe();">
Enter your name and email address to have this script sent right to your Inbox for later viewing. First Name Last Name Email