OW i was beaten to it well any way her is my newest code
matrix.js
Code:
function addC()
{
string = string.replace(/<([^<])*>/, ""); // Prevents HTML tags from effecting the page
if(x < string.length)
{
textBuffer += string.charAt(x);
dot = string.charAt(x); //Sets variable dot for checking
if (dot == ".") //Check for full stops in text
{ //If there is a full stop it
textBuffer=''; //starts a clean page
}
txt.innerHTML = textBuffer;
x++;
setTimeout('addC()', pause);
}
if (x == string.length)
{
if (home == "")
{
x=0;
textBuffer = "";
}
else
{
setTimeout('reLoc()', (pause * 4)) // Send viewer to home page with pause to read text.
}
}
}
function reLoc()
{
window.location = home; // Send viewer to home page
}
function beginTxt(wanted, site, delay)
{
if (document.getElementById)
{
home = site;
pause = delay;
txt = document.getElementById(wanted);
if(txt.innerHTML)
{
textBuffer = " "; // Stops the loss of Spaces
x = 0;
string = txt.innerHTML;
txt.innerHTML = " ";
addC();
}
}
}
Your HTML document
in head
Code:
<script src="matrix.js"></script>
in body (text to have effect done to it)
id can be changed
Code:
<span id="blah">Example text . You text goes here Full stops cause screen to clear then carry on typeing</span>
at end of your body
Code:
<script language="javascript">
/****************************
*THIS MUST NOT BE DELETED
*(c) .Alias.
*Contact c.alias.s@hotmail.co.uk
****************************/
/****************************
*Controls time between each Char.
*Change To Suit You
****************************/
beginTxt("blah", "", 100);
// "blah" is the ID of <span>
// "" is URL to load after finished if left blank loops text
// 100 is pause between each letter
</script>
enjoy
Bookmarks