Results 1 to 5 of 5

Thread: Change word upon mouseover.

  1. #1
    Join Date
    Jul 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default Change word upon mouseover.

    Hi All,

    I'm just looking for a way to change a word in a sentence upon mouseover that word.

    Any help'd be appreciated.

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    You can apply a rollover effect like with images. Use a <span> and use onmouseover to change the innerHTML. If you need to change it back, use onmouseout the same way.
    Do you just want a place to start or do you need someone to write this for you?

    Also, do you want this to be a quick version that works once? Or will you use it in many places on your page? (Harder to setup that way, but more efficient.)
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

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

    Default

    Doing what djr33 said, use the following code. http://jsfiddle.net/nile/Z83nA/
    Jeremy | jfein.net

  4. The Following User Says Thank You to Nile For This Useful Post:

    drluv888 (07-05-2011)

  5. #4
    Join Date
    Jul 2009
    Posts
    13
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    I'm getting a strange error: /dk/:8Uncaught TypeError: Cannot read property of 'dataset' of underfined.

    What would be the quick way to do use it just once? (As in, only one <span> is changeable). I only need it in one place.

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

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
  •