Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q1269 How can I scroll text across the screen without using the status bar and without using form fields?

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>

©2018 Martin Webb