secretsquirrel
Programmer
hi,
i've got a div, which contains a bit of text. i would like the page to load, wait a few seconds and change the div to a different bit of text, wait a few seconds more and change back to the original text, wait and then repeat.
i've tried the following, but it seems to crash the browser!
...can anyone suggest a way to do this? any help is appreciated.
thanks,
ss...
i've got a div, which contains a bit of text. i would like the page to load, wait a few seconds and change the div to a different bit of text, wait a few seconds more and change back to the original text, wait and then repeat.
i've tried the following, but it seems to crash the browser!
Code:
var lower = "blah blah blah";
var upper = "BLAH BLAH BLAH";
function test()
{
for(var i = 1; i > 0; i)
{
if(myDiv.innerHTML == "blah blah blah")
{
setTimeout("myDiv.innerHTML = upper", 3000);
} else {
setTimeout("myDiv.innerHTML = lower", 3000);
}
}
}
...can anyone suggest a way to do this? any help is appreciated.
thanks,
ss...