Results 1 to 5 of 5

Thread: permanently change color of text on mouseover

  1. #1
    Join Date
    Jul 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default permanently change color of text on mouseover

    hi, how can i get a piece of text to permanently change color after someone places their cursor over it once ...

    ex.
    "Blablablabla"
    then ....
    the surfer places his mouse over it and ...
    the color permanently changes just once to "Blablablabla"

    so basically, its not like a normal mouseover text change where every time you place the cursor over the text it changes to a different color and then when the cursor is removed from the text, it changes back to its normal color

    here, as soon as the person places his cursor over it, i want it to change and never change back .....

    all ideas will be appreciated ...
    thank you

  2. #2
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    <a href="..." onmouseover="this.style.color='#00ff00';">Text</a>
    This will change the colour of the link and then never change it back, as there's no onMouseOut handler.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  3. #3
    Join Date
    Jul 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    it works fine, BUT, it has to be a link to work ....
    how can it just be simple text and change color permanently?

  4. #4
    Join Date
    Jul 2005
    Posts
    20
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    nevermind, i got it to work fine ........ thanx, i just made a fw adjustments to ur code
    now it looks like:

    <span onmouseover="this.style.color='#000033';">
    text..... </span>

  5. #5
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Yes, it applies to any element.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

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
  •