[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Scrolling Text
>Andy Augustine wrote:
>>
>I know that there is a Java applet that can scroll text across the
>screen, but is there a smaller inline javascript that can do the same
>or similar thing??
>
>Thanks
>Brad Hughes
>bjhughes@students.uiuc.edu
>
Andy and Brad,
Try changing only the string assigned to msg and try this out...
To see it in action, http://www.ids.net/~pmccarty/
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 3.0//EN" "html.dtd">
<HTML>
<HEAD><TITLE>The TechnoHelm</TITLE>
<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;
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;
timerTwo=window.setTimeout(cmd,25);
}
else {
window.status=" ";
timerTwo=window.setTimeout("scroll_status(150)",25);
}
}
}
// -- End of JavaScript code -->
</SCRIPT></HEAD>
<BODY onLoad="timerONE=window.setTimeout('scroll_status(150)',25);">
hope this helps...
Pat McCarty
************************************************************
.
.:. Patrick T. McCarty
.:::. PC Programming/Internet
Consulting
.:::::. McLaughlin Research Corp.
***.:::::::.*** email : pmccarty@ids.net
*******.:::::::::.******* www : http://www.ids.net/~pmccarty/
********.:::::::::::.********
********.:::::::::::::.********
*******.::::::'***`::::.*******
******.::::'*********`::.******
****.:::'*************`:.****
*.::'*****************`.*
.:' *************** .
.
************************************************************