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

Moving text..

Status
Not open for further replies.

0211

Technical User
Oct 14, 2003
35
US
Hello again:
I found this code for a text that moves across the screen very slowly. How do I use it more than once? I have a few lines I want(well boss wants) to make them do this. Can anyone help? Thanks again. Here is the code:

<script language=&quot;JavaScript1.2&quot;>
message=&quot;Increase Your Profit!&quot;
var neonbasecolor=&quot;Black&quot;
var neontextcolor=&quot;Green&quot;
var flashspeed=115 //in milliseconds

///Don't change anything below this line/////

var n=0
if (document.all){
document.write('<font color=&quot;'+neonbasecolor+'&quot;>')
for (m=0;m<message.length;m++)
document.write('<span id=&quot;neonlight&quot;>'+message.charAt(m)+'</span>')
document.write('</font>')

//cache reference to neonlight array
var tempref=document.all.neonlight
}
else
document.write(message)

function neon(){

//Change all letters to base color
if (n==0){
for (m=0;m<message.length;m++)
tempref[m].style.color=neonbasecolor
}

//cycle through and change individual letters to neon color
tempref[n].style.color=neontextcolor

if (n<tempref.length-1)
n++
else{
n=0
clearInterval(flashing)
setTimeout(&quot;beginneon()&quot;,1000)
return
}
}

function beginneon(){
if (document.all)
flashing=setInterval(&quot;neon()&quot;,flashspeed)
}
beginneon()
</script>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top