Home Articles FAQs XREF Games Software Instant Books About Feedback Search Site-Map
irt.org logo

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

irt.org | Knowledge Base | DHTML | Q1269 [ previous next ]

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

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>

Provide feedback ...
AddThis Social Bookmark Button

Provide feedback ... AddThis Social Bookmark Button


Last Updated: 30th March 2008. Maintained by: Martin Webb
irt.org liability, trademark, document use, privacy statement and software licensing rules apply.
Copyright © 1996-2008 irt.org, All Rights Reserved.