Click to See Complete Forum and Search --> : moving text


tweetie37
10-30-2003, 02:09 PM
Hi everyone:
I have this code which I found for moving text (yah, my boss likes it!!). It's a nice one and I just want to know how to place it in different places on a page? I have a few phrases that want to move across the page(not quite across). How do I relate them?Thanks. here is the code:
<script language="JavaScript1.2">

message="Increase Gross Profit!"
var neonbasecolor="Black"
var neontextcolor="#ff3300"
var flashspeed=115 //in milliseconds


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

var n=0
if (document.all){
document.write('<font color="'+neonbasecolor+'">')
for (m=0;m<message.length;m++)
document.write('<span id="neonlight">'+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("beginneon()",1000)
return
}
}

function beginneon(){
if (document.all)
flashing=setInterval("neon()",flashspeed)
}
beginneon()
</script>

genuine.duck
10-30-2003, 06:38 PM
You can put it any where and any font size by inserting the entire script between TABLE DATA cells. I've put an example in txt format that you can copy and paste into a blank HTML page.
Hope this helps.

tweetie37
10-31-2003, 07:50 AM
Thanks for answering but I still have one line. Maybe I didn't understand you. Where should I insert my other lines? I have a few other phrases I want to do the same thing with!!!

genuine.duck
11-04-2003, 11:35 AM
I’ve tried various methods but cannot get round the document.all code.
I can create two lines of text using the script but the second one won’t work because of the set parameters of the script.
To the best of my knowledge to do the scrolling text for other lines would mean a complete rewrite.
However another simple solution would be to create the text using Word, pasting into MSPAINT. Adjusting the size of the borders accordingly and then to fill the different letters with the colour you want. Saving each step as a BMP file then using a GIF animator pasting them into the program. You can then adjust the speed, dithering etc. of the GIF text. After which using IMG SRC tags locate them where you want them to be on your web page.
If you send me your Email address I’ll send you an example.

genuine.duck
11-04-2003, 11:38 AM
Here's the second GIF file.

genuine.duck
11-04-2003, 11:40 AM
One last example.
There's plenty of sites where you can by a cheap GIF animator on-line.

tweetie37
11-04-2003, 11:48 AM
Thanks genuine.duck. This is wonderful. I'll do this. here is my email address if you want to send me an example;
morgan@roverwireless.com
Thanks again for your help.

shumway
11-04-2003, 11:57 AM
It would take some rewrite from your side but the consept is easy so I'm sure youll figure it out.

shumway
11-04-2003, 12:05 PM
LOL - sorry man!

Didnt take time to try your script - only read that you wanted scrolling text.