You are here: irt.org | FAQ | DHTML | Q1269 [ previous next ]
Try the following which will work in Netscape Navigator 4+ and Internet Explorer 4+:
<html>
<head>
<script language="JavaScript"><!--
var text = 'This should scroll across the page...........................................................................';
function scrolling() {
if (document.all)
document.all['scroll'].innerText = '<center>' + text + '<\/center>';
else if (document.layers) {
document.layers['scroll'].document.open();
document.layers['scroll'].document.write('<center>' + text + '<\/center>');
document.layers['scroll'].document.close();
}
text = text.substring(1) + text.substring(0,1);
setTimeout('scrolling()',100);
}
//--></script>
</head>
<body onLoad="scrolling()">
<p>
<span id="scroll" style="position:absolute">
</span>
</p>
</body>
</html>