Results 1 to 3 of 3

Thread: Can this have 3 sentences rotating with different colors?

  1. #1
    Join Date
    Jan 2009
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default Can this have 3 sentences rotating with different colors?

    I have the following script from http://www.dynamicdrive.com/dynamici.../neontext2.htm which applies a "moving light" (3 colors) to a sentence. Can I have 3 sentences rotating with different moving light colors (3 colors each with 3 sentences, it will be a total of 9 colors) instead of only one sentence? I am new in programming. Any help will be greatly appreciated. Thanks a lot.




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

    //Neon Lights Text II by G.P.F. (gpf@beta-cc.de)
    //visit http://www.beta-cc.de
    //Visit http://www.dynamicdrive.com for this script

    var message="Thank you for visiting Dynamic Drive!"
    var neonbasecolor="gray"
    var neontextcolor="yellow"
    var neontextcolor2="#FFFFA8"
    var flashspeed=100 // speed of flashing in milliseconds
    var flashingletters=3 // number of letters flashing in neontextcolor
    var flashingletters2=1 // number of letters flashing in neontextcolor2 (0 to disable)
    var flashpause=0 // the pause between flash-cycles in milliseconds

    ///No need to edit below this line/////

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

    function crossref(number){
    var crossobj=document.all? eval("document.all.neonlight"+number) : document.getElementById("neonlight"+number)
    return crossobj
    }

    function neon(){

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

    //cycle through and change individual letters to neon color
    crossref(n).style.color=neontextcolor

    if (n>flashingletters-1) crossref(n-flashingletters).style.color=neontextcolor2
    if (n>(flashingletters+flashingletters2)-1) crossref(n-flashingletters-flashingletters2).style.color=neonbasecolor


    if (n<message.length-1)
    n++
    else{
    n=0
    clearInterval(flashing)
    setTimeout("beginneon()",flashpause)
    return
    }
    }

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


    </script></h2>
    Last edited by newest; 02-04-2009 at 05:47 PM.

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    See:

    http://www.dynamicdrive.com/forums/s...ad.php?t=32420

    especially posts numbers 5 and 7 in that thread.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2009
    Posts
    15
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    Quote Originally Posted by jscheuer1 View Post
    See:

    http://www.dynamicdrive.com/forums/s...ad.php?t=32420

    especially posts numbers 5 and 7 in that thread.

    Sorry, I searched the forum with rotating text with colors, and it came up nothing. Next time I will key in the name of the script and search it that way. I just need a little bit education . Thank you for the reply.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •