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 7930535
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T20:27:30+00:00 2026-06-03T20:27:30+00:00

the hmtl code: <div id=nav> <ul> <li><a href=#>test 1</a></li> <li><a href=#>test 2</a> <div class=sub-nav>

  • 0

the hmtl code:

  <div id="nav">
 <ul>
 <li><a href="#">test 1</a></li>
 <li><a href="#">test 2</a>
  <div class="sub-nav">
  <p> <a href="#">link </a>  <a href="#">link </a> <a href="#">link </a>  </p>
  </div>

  </li>
 <li><a href="#">test 3</a>
  <div class="sub-nav">
  <p> <a href="#">link2 </a>  <a href="#">link3</a> <a href="#">link4 </a>  </p>
  </div>

</li>
 <li><a href="#">test 4</a></li>
 </ul>
  </div>

i want to do when the mouse hover on the li, it will show the corresponding part content(sub-nav). when the mouse move off the li, the corresponding part will be hidden.

.sub-menu css is display:none;

the following is my code, but doesn’t work.

$(function(){

    $("#nav ul li").mouseenter(function() {
       $(this).find(".sub-menu").show();
    });
});
  • 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-06-03T20:27:32+00:00Added an answer on June 3, 2026 at 8:27 pm

    Check you have .sub-menu class in CSS and JavaScript but .sub-nav in the markup.

    Here is the working solution:

    $("#nav ul li").hover(function() {
        $(this).find(".sub-nav").show();
    }, function() {
        $(this).find(".sub-nav").hide();
    });​
    

    DEMO: http://jsfiddle.net/e8GYJ/

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

Sidebar

Related Questions

Heres my HMTL code: <div class=BlockA> <h4>BlockA</h4> <div class=name>John Smith</div> <div class=number>2</div> <div class=name>Paul
this is my hmtl list. <div class=bradius3 taggy-beans> <div class=taggy-beans-search><input type=text id=search-tags class=bradiusMax style=></div>
We have a variable with hmtl code inside. <?php echo $list; ?> This will
The following Code <!DOCTYPE html> <html> <head> </head> <body> <div style=width:200px;height:200px;padding:0px;margin:0px;> <div style=background-color:red;position:relative;display:block;text-decoration:none;padding:0px;margin:0px;> <img
I run Aptana 2.0 on Win 7. I normally code HMTL/CSS/JS but the other
In below code, I pass an HMTL element and check whether parameter passed is
I want to consolidate my PHP files into a common class file, but I
I have hmtl template, and want to add some values there. I was going
My code to convert HMTL to PDF using tcpdf. $html = '<pre> <br/> <h3><a
I want to display jquery notifications, but at the moment it is fired onclick.

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.