Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    With my change text function can I also style my font as well?

    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/mov...hangetext.html

    Thanks.

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    You can hand code any element in the messages there. Let me quote this part:
    Code:
    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:
    Code:
    .style1{
    text-decoration:underline;
    font-size:8pt;
    color:#930;
    }
    You can do the same thing on the other messages.

    Hope that makes sense.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    New to the CF scene
    Join Date
    Oct 2008
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Great! Thanks very much.


  •  

    Posting Permissions

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