Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reverse scrollbar ????

Status
Not open for further replies.

iceb

Technical User
Jan 13, 2002
64
DK
Hi

How can I reverse the direction of the text in this

scroller ?

Code Follows.....


<html>
<head>
</head>

<body onload=&quot;scroll(); return true&quot;>


<script language=&quot;javascript&quot;>

var scrlStr=&quot;YOUR MESSAGE GOES HEREYOUR MESSAGE GOES HEREYOUR MESSAGE GOES HERE&quot;
var width=140;
var strLen=scrlStr.length;
var pos=1-width;

function scroll() {
var scroll = &quot;&quot;;
pos++;
if(pos == strLen)
pos =1 - width;
if(pos<0){
for(var i=1;i<=Math.abs(pos);i++)
scroll=scroll+&quot; &quot;;
scroll=scroll+scrlStr.substring(0,width-i+1);
}
else
scroll=scroll+scrlStr.substring(pos,pos+width);
window.status=scroll;
setTimeout(&quot;scroll()&quot;,75);
}


</script>

</body>
</html>
 
Is something like this any good?

<html>
<head>
</head>

<body onLoad=&quot;scroll();&quot;>

<script language=&quot;javascript&quot;>

var scrlStr=&quot;YOUR MESSAGE GOES HERE HERE IS YOUR MESSAGE&quot;
var strLen=scrlStr.length;
var pos=strLen;

function scroll() {
if (pos < 0)
pos = strLen;
window.status=scrlStr.substr(pos,(strLen - pos));
pos--;
setTimeout(&quot;scroll()&quot;,75);
}

</script>

</body>
</html>

Greg.
 
No I want the text NOT to disappear I want it to SCROLL OUT

of the area ok ????

 
Yeah, that's what I thought but didn't have time to figure it out :)

Greg.
 
Ok

How can I get the message to scroll out ??????

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top