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 5 of 5
  1. #1
    New Coder
    Join Date
    Nov 2004
    Posts
    91
    Thanks
    1
    Thanked 0 Times in 0 Posts

    onMouseOver help!

    Ok, here is what I am trying to acheive. I have two different classes of links in a css file. When you roll over the link I would like it to change from one class (in effect altering the appearance of the link) and back to the other. I don't generally use JavaScript, and i've played around with it for a little while with no luck. What is the easiest way to do this? And is there another way of doing this besides what I thought of?

    Thanks!

    Smesh

  • #2
    Regular Coder
    Join Date
    Jan 2004
    Location
    USA
    Posts
    364
    Thanks
    12
    Thanked 6 Times in 6 Posts
    You don't need javascript for this. Just use hover.

    Code:
    a.link {color: black;}
    a.link:hover {color: red;}

  • #3
    New Coder
    Join Date
    Nov 2004
    Posts
    91
    Thanks
    1
    Thanked 0 Times in 0 Posts
    ok, thanks a lot!

    Smesh

  • #4
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Note that you can't use the peudo hover element on other elements.

    If you want to do that, use

    onmouseover="this.className=blablah" onmouseout="this.className=blablah"

    CATdude about IE6: "All your box-model are belong to us"

  • #5
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,068
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Quote Originally Posted by mrruben5
    Note that you can't use the peudo hover element on other elements.

    If you want to do that, use

    onmouseover="this.className=blablah" onmouseout="this.className=blablah"

    That's only true with IE only. But there is fix for that without putting onmouseover and onmouseout handlers for all the elements.
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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