[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Svrolling text bar




Brad Hughes wrote:
> 
> A lot of people have been showing me examples of scrolling text accross
> the status bar but I'm interested in having scrolling text in the html
> page as a form or something like that.  The java applet you can put
> anywhere in the page as a object, Is the a javascript like this??
> 
> Brad Hughes
> bjhughes@students.uiuc.edu

Brad,
the script below is a scrolling text i grabbed from a previous post to the newsgroup. 
The lines with the three stars (***) are the lines that needs to be changed in order 
to output it to a form as opposed to the status. Insteas of using 
window.status="string" you'd use window.form.[form-element] instead.


<SCRIPT LANGUAGE="JavaScript">
<!-- Beginning of JavaScript Applet
function scroll_status(seed)
{
        var msg="Put YOUR MESSAGE IN HERE !!"
        var out = " ";
        var c   = 1;

        if (seed > 150) {
                seed--;
                var cmd="scroll_status(" + seed + ")";
                timerTwo=window.setTimeout(cmd,25);
        }
        else if (seed <= 150 && seed > 0) {
                for (c=0 ; c < seed ; c++) {
                        out+=" ";
                }
                out+=msg;
                seed--;
                var cmd="scroll_status(" + seed + ")";
                    window.status=out;				 //***
		    //window.form.[]=out;
                timerTwo=window.setTimeout(cmd,25);
        }
        else if (seed <= 0) {
                if (-seed < msg.length) {
                        out+=msg.substring(-seed,msg.length);
                        seed--;
                        var cmd="scroll_status(" + seed + ")";
                        window.status=out;			//***
			//window.form.[]=out;
                        timerTwo=window.setTimeout(cmd,25);
                }
                else {
                        window.status=" ";			//***
			//window.form.[]=" ";
                        timerTwo=window.setTimeout("scroll_status(150)",25);
                }
        }
}
// -- End of JavaScript code -->
</SCRIPT>
-- 
<=========================================================>
Anthony Nguyen                  |  anthonyn@skunkink.com
Lead Programmer/WebMaster       |  ph:  310 826-8388
Skunk Works Multimedia          |  fax: 310 826-5288
				|  http://www.skunkink.com
<=========================================================>