Click to See Complete Forum and Search --> : show and disappear


eduac
12-14-2003, 07:38 PM
guys,

anybody can help ? i need a code to show a text, after that, disappear, and the next line, show the another text...and...again.....
like this:

show > text one
after one second, disappear > text one
show > text two
after one second, disappear > text two....

TheBearMay
12-15-2003, 07:15 AM
If you want it to appear in the same place try something like:



var strArray = ["Now is the time", "for all good men", ...]
var strInx = 0;

function dispText(){
dispDiv.innerHTML="<b>"+strArray[strInx]+"</b>;
strInx++
setTimeout("dispText()", 1000);
}

...
<body onload="dispText();">

<div id=dispDiv....

eduac
12-15-2003, 07:47 AM
thanks man...i will try that

TheBearMay
12-15-2003, 07:50 AM
May want to add this line into the function after the strInx++:

if (strInx > strArray.length-1) strInx=0;