Results 1 to 5 of 5

Thread: Change color on text

  1. #1
    Join Date
    Feb 2007
    Location
    Wasilla, Alaska
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Change color on text

    1) Script Title: Shockwave Text

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici.../shockwave.htm

    3) Describe problem: I have inserted this into the script on my page and it works great, I can change text no sweat. What I can't figure out is how to change the color on the text. ANy ideas? Thanks in advance!

  2. #2
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Well, you need to add a var, so at the top where all of the vars already there, you need to add this:
    Code:
    var font_color = "#C100C1"; //You can change this to any hex code you want, or rgb. Doesn't matter.
    Then change this line of code:
    Code:
    output += "<font style='font-size: "+ q +"pt'>" +tekst[s].substring(w,w+1)+ "</font>";
    To this:
    Code:
    output += "<font style='font-size: "+ q +"pt;color: "+font_color+"'>" +tekst[s].substring(w,w+1)+ "</font>";
    What this is doing is adding the color thing to your style with the var font_color, then you need to cahnge this line[a few lines under the previous]:
    Code:
      
    output += "<font style='font-size: " + size + "pt'>" +tekst[s].substring(k,k+1)+ "</font>";
    To this:
    Code:
    output += "<font style='font-size: " + size + "pt';color: "+font_color+"'>" +tekst[s].substring(k,k+1)+ "</font>";
    Jeremy | jfein.net

  3. #3
    Join Date
    Feb 2007
    Location
    Wasilla, Alaska
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Dude, I really appreciate the help. I had some success with your suggestions, I made the code changes you posted above, I was able to change the lead text color. But I still can't change the main text color. Now here I would like to say, I KNOW its me that is doing something wrong. I am even pretty sure that you explained in detail how to change the color in your post above, but me in my ignorance am just not getting it. So I hope you don't mind if I trouble you some more. Here is the link to the site I put the code on.

    http://www.carlesonhomes.com/current_listings.html

    You can see where the text effect is. I was able to change the text color to red on the lead. What I can't seem to figure out is how to change the black text to a different color. Thanks in advance!

  4. #4
    Join Date
    Jan 2008
    Posts
    4,168
    Thanks
    28
    Thanked 628 Times in 624 Posts
    Blog Entries
    1

    Default

    Hmm, I don't know how to fix this.

    But try changing this line:
    Code:
    idee.innerHTML = output;
    To:
    Code:
    idee.style.color = font_color;
    idee.innerHTML = output;
    Jeremy | jfein.net

  5. #5
    Join Date
    Feb 2007
    Location
    Wasilla, Alaska
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Nile you da MAN!!!! I don't know how much money you make now my brotha, but it ain't enough! That was the ticket. Worked like a champ! I got it changed to the blue to match the rest of the page. Looks a lot better. Thanks a mil dude!

    Kevo

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
  •