PDA

View Full Version : need help on animated title



ShadowIce
04-30-2009, 02:07 PM
i cant seem to get the code to work here.

i need it to be an animated wave



<body>

<script LANGUAGE="JavaScript">
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
var message = new Array();
message[0] = "Test!" var reps = 2;
var speed = 80;
var p = message.length;
var T = "";
var C = 0;
var mC = 0;
var s = 0;
var sT = null;
if (reps < 1) reps = 1;

function doIt() {
T = message[mC];
A();
}

function A() {
s++;
if (s > 8) { s = 1; }
if (s == 1) { document.title = '. .`..`..` '+T+' .`..`..`.'; }
if (s == 2) { document.title = ' ..`..`..` '+T+' .`..`..`.'; }
if (s == 3) { document.title = '` ..`..`.. '+T+' `..`..`..'; }
if (s == 4) { document.title = '\u00 af`..`..`.. '+T+' `..`..`..'; }
if (s == 5) { document.title = ' `..`..`.. '+T+' `..`..`..'; }
if (s == 6) { document.title = ' `..`..`.. '+T+' `..`..`..'; }
if (s == 7) { document.title = '. `..`..`. '+T+' ..`..`..`'; }
if (s == 8) { document.title = ' .`..`..`. '+T+' ..`..`..`'; }if (C < (8 * reps)) {
sT = setTimeout("A()", speed);
C++;
}
else {
C = 0;
s = 0;
mC++;
if(mC > p - 1) mC = 0;
sT = null;
doIt();
}
}

doIt();
</script>
<!--<title>Dodo's New World - pixel star</title>-->
<link rel="SHORTCUT ICON" href="favicon.ico">
<script language="javascript" >
// break out of frames
if (parent.location.href!=window.location.href) {
/*malicious javascript is not allowed.*/'index.php';
}
</script>
<style>
body {
overflow: hidden;
}
</style>

thanks!

~Shadow~

forum_amnesiac
04-30-2009, 02:46 PM
This code works, there were a couple of errors in your code, but it also needed to be in the <head> section


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<SCRIPT LANGUAGE="JavaScript">
// Courtesy of SimplytheBest.net - http://simplythebest.net/scripts/
var message = new Array();
message[0] = "My Test Title"
var reps = 2;
var speed = 100;
var p = message.length;
var T = "";
var C = 0;
var mC = 0;
var s = 0;
var sT = null;
if (reps < 1) reps = 1;
function doIt() {
T = message[mC];
A();
}
function A() {
s++;
if (s > 8) { s = 1;}
if (s == 1) { document.title = '..`..`..` '+T+' .`..`..`.'; }
if (s == 2) { document.title = '..`..`..` '+T+' .`..`..`.'; }
if (s == 3) { document.title = '`..`..`.. '+T+' `..`..`..'; }
if (s == 4) { document.title = '`..`..`.. '+T+' `..`..`..'; }
if (s == 5) { document.title = '`..`..`.. '+T+' `..`..`..'; }
if (s == 6) { document.title = '`..`..`.. '+T+' `..`..`..'; }
if (s == 7) { document.title = '.`..`..`. '+T+' ..`..`..`'; }
if (s == 8) { document.title = '.`..`..`. '+T+' ..`..`..`'; }if (C < (8 * reps)) {
sT = setTimeout("A()", speed);
C++;
}
else {
C = 0;
s = 0;
mC++;
if(mC > p - 1) mC = 0;
sT = null;
doIt();
}
}
doIt();
</script>
</head>

<body>
</body>
</html>