Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 355803
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T12:03:06+00:00 2026-05-12T12:03:06+00:00

I have tried to find some decent documentation on traversing in jQuery, but have

  • 0

I have tried to find some decent documentation on traversing in jQuery, but have not found a decent resource, any suggestions would be much appreciated.

I am trying to create a simple animation for a menu.

I have a simple menu:

<ul class='contentNav'>
 <li><a href='#'>One</a>
 <li><a href='#'>Two</a>
 <li><a href='#'>Three</a>
 <li><a href='#'>Four</a>
</ul>

And a simple jquery function to change the background color of the tag:

$(document).ready(function(){

   $(".contentNav a").hoverIntent(
   function(over) {
     $(this).animate({backgroundColor: "#844"}, "fast");
     $(this).parent().find("li a").animate({backgroundColor: "#090"}, "fast");
   },
   function(out) {
     $(this).animate({backgroundColor: "#000"}, "fast");
     $(this).parent().find("li a").animate({backgroundColor: "#000"}, "fast");
   });
}); 

The trouble is with the lines:

$(this).parent().find("li a").animate({backgroundColor: "#090"}, "fast"); 
$(this).parent().find("li a").animate({backgroundColor: "#000"}, "fast");

I am trying to select all of the link tag items that are not currently hovered over and set their background color. How do I do this.

Thanks.


UPDATE


I have taken all of the recommendations and come up with the following code:

$(this).parent().parent().find("a").not(this).animate({backgroundcolor: "#555"}, 100)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-12T12:03:07+00:00Added an answer on May 12, 2026 at 12:03 pm

    From the hoverIntent docs, the hoverIntent call takes a configuration object, not two methods. Try this:

    $(document).ready(function(){
      $(".contentNav a").hoverIntent({
        over: function() {
          $(this).animate({backgroundColor: "#844"}, "fast");
          $(this).parent().parent().find("li a").not(this).animate({backgroundColor: "#090"}, "fast");
        },
        out: function() {
          $(this).parent().parent().find("li a").animate({backgroundColor: "#090"}, "fast");
        }
      });
    });
    

    Hat tip to richsage for his answer, which identified the grandparent problem.
    And another to Vertigo for the idea to use the temporary class and not.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have tried to find some articles on my problem, but haven't found anything
I have tried to do some reading about it, but I failed to find
I have tried rectifying the code below. But I am not able to find
I have tried to find some resource for Subversion how to make revision history
I have tried to find some documentation on this on the app engine and
I'm developing an app with Rails 3.1.2 but I can't find some documentation that
Guys i have a little problem, i tried to find some examples on GeoIP
I have tried to find some information on D. I do especially like this
I tried to find some clue in the list but I couldn't, so sorry
I have tried to find a solution for this but most of the literature

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.