#1
  1. No Profile Picture
    flamingsouls
    Guest
    Devshed Newbie (0 - 499 posts)
    Hi

    For the life of me, I can not find a book that tells me how to change the color of a link when someone moves their mouse over it. Could you guys help?

    thx
    Josh
  2. #2
  3. No Profile Picture
    scollo
    Guest
    Devshed Newbie (0 - 499 posts)
    Designing with JavaScript: Creating Dynamic Web Pages, by Nick Heinle. ISBN 1565923006
    pages 140-141

    <HTML>
    <HEAD>
    <STYLE>
    .on {color:blue}

    .off{color:black}
    </STYLE>
    <BODY>
    <A HREF="customers.html"
    CLASS="off"
    onMouseOver="this.className='on';"
    onMouseOut="this.className='off';"
    >
    Customers
    </A></BODY>
    </HTML>

    I've never used this myself. I just copied it right out of the book for you. (BTW: It's a good book to have.)
  4. #3
  5. No Profile Picture
    dahamsta
    Guest
    Devshed Newbie (0 - 499 posts)
    However! It's not cross-browser compatible, it'll only work in Explorer, although it may be implemented in NN 4.6, just released. As a browser and a webmaster, there's nothing I hate more than browser-biased sites...

    adam
  6. #4
  7. No Profile Picture
    scollo
    Guest
    Devshed Newbie (0 - 499 posts)
    Oh my God! You're right! I didn't even realise that this was IE-dependent. I feel dirty.

    It's ironic, too, because I develop Netscape-only intranet applications. I've just never had to bother with mouseovers or dynamically-assigned CSS classes. I apologise to Earth and all of its inhabitants.
  8. #5
  9. No Profile Picture
    dahamsta
    Guest
    Devshed Newbie (0 - 499 posts)
    Well, Netscape and Microflot are still going in different directions in some cases, no matter what the W3C have to say. If you want mouseover effects, you're probably better of sticking with images for the mo.

    adam

Similar Threads

  1. change css onMouseOver
    By Tobbe in forum CSS Help
    Replies: 8
    Last Post: January 26th, 2005, 02:17 PM
  2. OnMouseOver does nothing in Netscape
    By Tommy Moo in forum HTML Programming
    Replies: 2
    Last Post: February 11th, 2004, 02:37 PM
  3. Image Button - onmouseover & onmouseout
    By linhardt in forum HTML Programming
    Replies: 4
    Last Post: February 2nd, 2004, 07:41 AM
  4. Forms, Submit and onMouseOver
    By sharky121 in forum HTML Programming
    Replies: 2
    Last Post: March 18th, 2002, 04:19 PM
  5. Removing onMouseOver from 5000 Links?
    By Ctb in forum HTML Programming
    Replies: 17
    Last Post: March 4th, 2002, 06:58 PM

IMN logo majestic logo threadwatch logo seochat tools logo