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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T10:28:24+00:00 2026-05-27T10:28:24+00:00

I am trying to create a sub navigation. Right now I have two subnav.

  • 0

I am trying to create a sub navigation. Right now I have two subnav. When i hover over the first item on the main menu the corresponding submenu appears. But when I hover over the second item the second sub nav appears OVER the first one. How can I write the code so that this does not happen?

url: http://arabic001.com

$(document).ready(function() {

        $('#arbNavText01').mouseover(function()  {
            $('#subNav01').show('slow');
        });

        $('#subNav01').mouseleave(function() {
            $('#subNav01').hide('slow');
        }); 


         $('#arbNavText02').mouseover(function()  {
            $('#subNav02').show('slow');
        });

        $('#subNav02').mouseleave(function() {
            $('#subNav02').hide('slow');
        }); 



        })

I just tried the below suggestion from Scott and I am not able to show and hide the submenu on hover. Any ideas of how to solve this problem? Here are my new codes:

html

<div id="menu01" class="menu_item">
            <div id="engNavText01">Alphabet</div>
            <div id="arbNavText01">الأحرف</div>
            <div id="subNav01" style="display:none;">
                <a href="colors" class="subNav">
                    <span style="font-size:26px; cursor:pointer;">قراءة</span</a>
                    <br>reading<br><br>
        </div>
        </div>

        <div id="menu02" class="menu_item">
            <div id="engNavText02">Numbers</div>
            <div id="arbNavText02">الأحرف</div>
            <div id="subNav02" style="display: none; ">
                <a href="colors" class="subNav">
                    <span style="font-size:26px; cursor:pointer;">قراءة</span</a>
                    <br>reading<br><br>
        </div>
        </div>

and the JS

$(document).ready(function() {

$('.menu_item').children().hover(
function(){
    $subNav = $(this).parents('menu_item').children("div[id^='subNav'");
    if ($subNav.css('display', 'none')){
        $subNav.show('slow');
    }
},
function(){
    $(this).parents('menu_item').children("div[id^='subNav'").hide('slow');
});

})
  • 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-27T10:28:24+00:00Added an answer on May 27, 2026 at 10:28 am

    You’ve created a mouseleave event, but you’ve only attached it to the submenu. So in order to make a menu disappear, the user will have to hover over the submenu and then move out. You could achieve what you want by hiding other submenus before opening a new one. So keeping your mouseleave events as you have them, you could modify your 2 mouseover events to this:

        $('#arbNavText01').mouseover(function()  {
            $('#subNav02').hide('slow');
            $('#subNav01').show('slow');
        });
        $('#arbNavText02').mouseover(function()  {
            $('#subNav01').hide('slow');
            $('#subNav02').show('slow');
        });
    

    Edit for comment:
    I was thinking about that when I went and looked at your page originally. I think if you used a slightly different structure in your html this could be done. Right now your menu divs aren’t clearly structurally related to each other so maybe add a div that can contain the 3 elements associated with each menu item.

    I’m going to spit ball an idea, it may not even work let alone be the best way.

    <div id="menu01" class="menu_item">
        <div id="engNavText01">Alphabet</div>
        <div id="arbNavText01">الأحرف</div>
        <div id="subNav01" style="display: none; ">
            <a href="colors" class="subNav"><span style="font-size:26px; cursor:pointer;">قراءة</span</a>
            <br>reading<br><br>
        </div>
    </div>
    <div id="menu02" class="menu_item">...
    

    Edited JS, I think now it could work

    $('.menu_item').hover(
        function(){
            $subNav = $(this).children("div[id^='subNav']");
            if ($subNav.css('display', 'none')){
                $subNav.show('slow');
            }
        },
        function(){
            $(this).children("div[id^='subNav']").hide('slow');
        }
    );
    

    Was trying it out with a JSFiddle, seems alright there. Might need some modification for your uses.

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

Sidebar

Related Questions

I'm trying to create a drop-down menu acting as the sub-menu of a main
I have a navigation menu provider that I am trying to move over to
I am trying to create nested resources where the sub-resource doesn't have an existence
i am trying to create a sub navigation which is followed by seperator line
In Silverlight 3, I am trying to create a pop up menu for navigation.
I am trying to create a dynamic menu with simple navigation. The problem is
i have been trying to create a rule for dynamic sub-domains and tried many
I am trying to create a drop sub-menu to the side of the nav
Trying to create two clients; one is pub/sub, the other is a standard connection.
I'm trying to create a basic navigation and I'd like to have a horizontal

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.