Dkid
Power Member
Oi pessoal,
O objectivo é o seguinte : quero que apareca o texto a escrever-se, sem ser logo o texto todo, ir aparecendo, so que neste "exemplo" aqui o texto sempre que há um "."(ponto) ele apaga o texto e escreve o resto do texto ate xegar a outro "." e volta a apagar e escreve o resto... é possivel ??
Heis o codigo que tava a usar..
O objectivo é o seguinte : quero que apareca o texto a escrever-se, sem ser logo o texto todo, ir aparecendo, so que neste "exemplo" aqui o texto sempre que há um "."(ponto) ele apaga o texto e escreve o resto do texto ate xegar a outro "." e volta a apagar e escreve o resto... é possivel ??
Heis o codigo que tava a usar..
Código:
<html>
<head>
<title>MATRIX TEXT!</title>
<script language="javascript">
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)
{
setTimeout('reLoc()', (pause * 4)) // Send viewer to home page with pause to read text.
}
}
function reLoc()
{
window.location = "[URL="http://www.dynamicdrive.com"]http://www.dynamicdrive.com[/URL]"; // Send viewer to home page
}
</script>
</head>
<body bgcolor=#000000>
<font color="green">
<span id="text">This Script was created by .Alias .Do Not Remove commenting .
c[dot]alias[dot]s@hotmail[dot]co[dot]uk</span>
</font>
<script language="javascript">
/****************************
*THIS MUST NOT ME DELETED
*(c) .Alias.
*Contact [EMAIL="[email protected]"][email protected][/EMAIL]
****************************/
/****************************
*Controls time between each Char.
*Change To Suit You
****************************/
pause = 150;
if (document.getElementById)
{
txt = document.getElementById("text");
if(txt.innerHTML)
{
textBuffer = " "; // Stops the loss of Spaces
x = 0;
string = txt.innerHTML;
txt.innerHTML = " ";
addC();
}
}
</script>
Última edição: