PDA

View Full Version : 2 Neon Lights Text on 1 page - how do I do that?


wwwolf
11-17-2002, 12:53 PM
Hello,
on javascriptkit.com I have found a Neon Light Text-javascript which I really like. You can find it in the section Text effects: http://www.javascriptkit.com/script/script2/neontext.shtml.

I have two questions:
* I don't know how to make two different Neon Light Texts on one page, that can work separately. When I put two of them on one page, only one of them works.

* Is it possible to let the second one start later than the first one, and if so, how do I do that?

Thanks for your help!
Take care,
Wolf, Belgium

cg9com
11-17-2002, 05:05 PM
says page not found for me
can you post the code your using?

wwwolf
11-17-2002, 06:13 PM
OK, good idea: here's the code. Hope someone can help me... Thanks!
Rolf


<h2>
<script language="JavaScript1.2">

/*
Neon Lights Text
By JavaScript Kit (http://javascriptkit.com)
Over 400+ free scripts here!
*/

var message="Welcome to JavaScript Kit!"
var neonbasecolor="gray"
var neontextcolor="yellow"
var flashspeed=100 //in milliseconds

///No need to edit 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()",1500)
return
}
}

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


</script>
</h2>