View Full Version : Change color on text
Burnt Offering
03-19-2008, 07:35 PM
1) Script Title: Shockwave Text
2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex10/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!
Well, you need to add a var, so at the top where all of the vars already there, you need to add this:
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:
output += "<font style='font-size: "+ q +"pt'>" +tekst[s].substring(w,w+1)+ "</font>";
To this:
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]:
output += "<font style='font-size: " + size + "pt'>" +tekst[s].substring(k,k+1)+ "</font>";
To this:
output += "<font style='font-size: " + size + "pt';color: "+font_color+"'>" +tekst[s].substring(k,k+1)+ "</font>";
Burnt Offering
03-20-2008, 08:20 PM
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!:)
Hmm, I don't know how to fix this.
But try changing this line:
idee.innerHTML = output;
To:
idee.style.color = font_color;
idee.innerHTML = output;
Burnt Offering
03-21-2008, 04:02 PM
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
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.