SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Nov 2002
    Location
    Maryland
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jQuery Hover Help

    How can I stop all the H2 tags from changing color at the same time when just one H2 tag is hovered over? I want the hover to apply to each H2 element individually and not as a group.

    Please mouse over "Business Litigation" on the following link and you will see what I mean. All H2 tags change color when just the first one is moused over.

    http://mos.herrmanneasyedit.com/prac.../21-litigation

    Code:
    $('div.collapsed').find('h2').unbind('mouseenter mouseleave').hover(
    
      function() {
         $("h2").css("color","#78a9c0");
       }, 
         
      function() {
        $("h2").css("color","#B5121B");
      }
    
    )
    Any help is appreciated.

  2. #2
    dooby dooby doo silver trophybronze trophy
    spikeZ's Avatar
    Join Date
    Aug 2004
    Location
    Manchester UK
    Posts
    13,806
    Mentioned
    157 Post(s)
    Tagged
    3 Thread(s)
    try
    Code:
     function() {
        $(this).css("color","#78a9c0"); 
      },
    
    function() { 
        $(this).css("color","#B5121B"); 
    }
    Mike Swiffin - Community Team Advisor
    Only a woman can read between the lines of a one word answer.....

  3. #3
    SitePoint Addict
    Join Date
    Nov 2002
    Location
    Maryland
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Spike! That worked.


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
  •