...

View Full Version : With my change text function can I also style my font as well?



codonnell456
10-11-2008, 08:00 AM
I found a "change text" script that changes snippets of text (that you've pre-programmed) in a div as you mouseover different links.

I was playing with it to see if I could vary the font size and color of INDIVIDUAL WORDS in the output, but was unsuccessful.

I have a link below to my experimental page containing the script, plus showing the kind of font property changes that I thought might be possible.

Since I'm relatively new to javascript, I may be asking a dumb question. Just wondering, even though the text data has to pass through all of these functions, can you still somehow set varying font properties in the output? Or can someone suggest a work around (hopefully not too painful)?

Here's the link to my experimental page: http://homepage.mac.com/ccfinder/movieclassics/changetext.html

Thanks.

rangana
10-11-2008, 09:40 AM
You can hand code any element in the messages there. Let me quote this part:


messages[1]="<span class='style1'>So I found this cool</span> way of changing text in a stationary spot by mousing over different links."

...you can add highlighted.

Which gives you the opportunity to give that element a style via CSS:


.style1{
text-decoration:underline;
font-size:8pt;
color:#930;
}


You can do the same thing on the other messages.

Hope that makes sense.

codonnell456
10-11-2008, 06:19 PM
Great! Thanks very much.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum