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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T07:19:40+00:00 2026-06-13T07:19:40+00:00

I have created a collapsible menu with stucture like: Parent Parent 2 Parent 3

  • 0

I have created a collapsible menu with stucture like:

  • Parent
  • Parent 2
  • Parent 3
    • Sub category

I have the following javascript

    var config = {
        over: function() { $(this).children('ul').slideDown('slow'); },
        timeout: 5,
        out: function() { }
    }

    $("ul.root-tags li").hoverIntent(config);

    $('ul.root-tags').mouseout(function() {
        $(this).children('li ul').each(function () {
            $(this).slideUp('slow');
        });
    });

Basically I want to open sub categories on hover of the parent item but only collapse opened subcategories on mouseout of the entire list, not just the parent item. My current code does not do this. What changes do I need to make?

jsfiddle is here http://jsfiddle.net/zkhVC/4/

  • 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-13T07:19:41+00:00Added an answer on June 13, 2026 at 7:19 am

    This should address what you are asking for:

    $('#head').mouseleave(function() {
    
        $(this).find('li ul').each(function () {
            $(this).stop().slideUp('slow');
        });
    
    });
    
    $("ul li").mouseenter(function() {
        $(this).children('ul').stop().slideDown('slow');
    });​
    

    Fiddle

    Here

    Explanation

    • Do not use hover event, because it will get fired over and over again you are over the element. You want to use mouseenter instead.
    • Use mouseleave instead of mouseout:

    The mouseleaveevent differs from mouseoutin the way it handles event
    bubbling. If mouseout were used in this example, then when the mouse
    pointer moved out of the Inner element, the handler would be
    triggered. This is usually undesirable behavior. The mouseleaveevent,
    on the other hand, only triggers its handler when the mouse leaves the
    element it is bound to, not a descendant. So in this example, the
    handler is triggered when the mouse leaves the Outer element, but not
    the Inner element.

    • Take a deeper look at how selectors works: you do not need of the children function here.
    • You want to use the stop function before calling an animation to prevent animations buffering.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an accordion menu. Here is my js code: var menu =
I have a dozen collapsible list (like the following) and each gets a bunch
I have created 3 classes as following Ext.mine.TextParent - Inherting from Textfield Ext.mine.child.TextChildA -
I have created a function that shows/hides different messages according to a combination of
I have created category for UIAlertView and overridden the delegate method willPresentAlertView but my
Have created a ATL COM project through which I am inserting Menu Items to
Have created a custom navigation menu in wordpress that has some pages and some
I am having trouble with a navigation menu I have created. Basically, the navigation
I have collapsible sections created using jQuery UI Accordion. When each section is expanded
I've created collapsible links for navigating my page. All menu items in my navigation

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.