Java Script for scrolling text within the browser's status bar



To have a message scroll across the bottom of your browser's status bar window, you need to have the following JavaScript in your file. Since typing it all out would be very tedious, you can just return again to the sample page, access the source code for the main frame, and copy and paste it into a new Simpletext or Notepad file.

<BODY BGCOLOR="#FFFFFF"
onload="timerONE=window.setTimeout('scrollit_r2l(110)',500);">

<script language="JavaScript">

<!--Beginning of JavaScript Applet -------------------

function scrollit_r2l(seed)
{           var m1 = "This is a sample of scrolling text"

          var msg=m1
          var out = " ";
          var c = 1;

          if(seed > 100) {
                seed--;
                var cmd="scrollit_r2l(" + seed + ")";
                timerTwo=window.setTimeout(cmd,50);
          }
          else if (seed <= 100 && seed > 0) {
                for (c=0 ; c < seed ; c++) {
                      out+=" ";
                }
                out+=msg;
                seed--;
                var cmd="scrollit_r2l(" + seed + ")";
                    window.status=out;
                timerTwo=window.setTimeout(cmd,50);
          }
          else if (seed <=0) {
                if (-seed < msg.length) {
                    out+=msg.substring(-seed,msg.length);
                    seed--;
                    var cmd="scrollit_r2l(" + seed + ")";
                    window.status=out;
                    timerTwo=window.setTimeout(cmd,50);
                }
                else  {
                    window.status=" ";
                    timerTwo=window.setTimeout("scrollit_r2l(100)",45);
                }
          }
}
// -- End of JavaScript code -------------- -->

</script>


To modify the code, replace the <BODY> information with your own background image information, but keep the java script reference information within the body tag. The script will not work if you do not have the reference information in the <BODY> tag. The only other thing you need to modify is the text line that now reads "This is a sample of scrolling text". This is another piece of code that is a case where you do not need to really understand everything about it. You only need to know that you need all of it for it to work, and know which lines to alter so you own message will be scrolled instead of what the original code has.


~~~~~~~~~~~~~~~


There are many more ways to enhance your website that were not discussed here in this tutorial. Some are simple to do, and some are more complicated. The best thing to do is to keep surfing the internet until you find an effect that you like and then read the source code and try to figure out how they did it. After a while, reading source code will be second nature to you and you will be easily able to pick out of it what you really want and ignore what you don't need.



















Hosted by www.Geocities.ws

1