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 2 of 2
  1. #1
    New Coder
    Join Date
    Oct 2011
    Posts
    81
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Clicked link to stay at hover state?

    Okay so basically I have this little menu to toggle between two tags

    Code:
    <ul class="sortByList">
    <li><a href="#" class="sort" onclick="reveal('1');">1</a></li>
    <li><a href="#" class="sort" onclick="reveal('2');">2</a></li>
    </ul>
    Now what I would like is that when I click one of the links, that the hover state will stay active, and when you click the other link that it switches (so that the hover state that was active on the clicked link will be remove and switch to the tag clicked after that). I've been looking up all kind of jQuery code but nothing seems be working for me and it totally confuses me?

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,175
    Thanks
    23
    Thanked 601 Times in 600 Posts
    Why are you using a 'hover state'? use display:none and display:block
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."


  •  

    Posting Permissions

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