Introduction
In this blog, we will know how to scroll the text in the
status bar using JavaScript.
Store the files as .html or .htm extension. Run it in IE.
Example-1
- <html>
- <head>
- <title>Javascript ScrollText</title>
- <script language="javascript">
- msg="This is an example of scrolling message";
- spacer="............ .............";
- pos=0;
- function ScrollMessage()
- {
- window.status=msg.substring(pos,msg.length)+spacer+msg.substring(0,pos);
- pos++;
- if(pos>msg.length)
- pos=0;
- window.setTimeout("ScrollMessage()",100);
- }
- ScrollMessage();
- </script>
- </head>
- <body>
- <p>Scrolling Message Example</p>
- <p>Look at the status line at the bottom of the page</p>
- </body>
- </html>

Suvendu Shekhar GiriPosted May 5, 2020, 2:53 PM
Hasn't these code snippets copied from "SAMS Teach Yourself JavaScript in 24 hours" book?
Suvendu Shekhar GiriPosted May 5, 2020, 2:45 PM
It would be very helpful for people if you can add some description or explanation about the code you have shared. Otherwise, people will just do copy-paste without understanding how it works. Hope, you understand.