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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to scroll line of text from right to left and not left to right? 1

Status
Not open for further replies.

Tivoli0

MIS
Dec 7, 2001
41
0
0
IL
Hi all,

I have a script with a function that causes a line of text to scroll my screen from left to right, something like "Welcome to my web site".

How can I have that line scroll from right to left?

Thanks for any help! -Tivoli0
 
I'm not too good at guessing games, but I'd say that if you post your script here someone will be able to answer your question in no time.
 
Hi dwarfthrower,

Thanks for your reply! Here is the code:
Code:
<h2 id=&quot;txtScroll&quot; style=&quot;position:relative;left:-400;font-style:italic&quot;><font face=&quot;Arial&quot;>Welcome to my site!</font></h2>

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

if (document.getElementById||document.all)
var crossheader=document.getElementById? document.getElementById(&quot;txtScroll&quot;).style : document.all.flyin.style

function txtRoll(){
if (parseInt(crossheader.left)<0)
crossheader.left=parseInt(crossheader.left)+20
else{
crossheader.left=0
crossheader.fontStyle=&quot;normal&quot;
clearInterval(start)
}
}

if (document.getElementById||document.all)
start=setInterval(&quot;txtRoll()&quot;,50)

</script>

Appreciate any help! -Tivoli0
 
No sweat:
Code:
<h2 id=&quot;txtScroll&quot; style=&quot;position:relative;left:
1400
Code:
;font-style:italic&quot;><font face=&quot;Arial&quot;>Welcome to my site!</font></h2>

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

if (document.getElementById||document.all)
var crossheader=document.getElementById? document.getElementById(&quot;txtScroll&quot;).style : document.all.flyin.style

function txtRoll(){
if (parseInt(crossheader.left)
>0
Code:
)
crossheader.left=parseInt(crossheader.left)
-20
Code:
else{
crossheader.left=0
crossheader.fontStyle=&quot;normal&quot;
clearInterval(start)
}
}

if (document.getElementById||document.all)
start=setInterval(&quot;txtRoll()&quot;,50)

</script>
</body>
</html>
 
Hi dwarfthrower,

You got a star for saving me hours of headache!!!

Thanks!!! -Tivoli0
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top