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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:05:37+00:00 2026-06-13T12:05:37+00:00

I have a problem I want to make a jquery submenu like this: <ul

  • 0

I have a problem I want to make a jquery submenu like this:

    <ul id="submenu" class="menu">
    <li class="item-1"><a href="test.html">Test 1</a></li>
    <li class="item-2 deeper parent">
        <a href="test.html">Test 2</a>
        <ul>
            <li class="item-xy"><a href="#">Test 1</a></li>
            <li class="item-xy"><a href="#">Test 1</a></li>
            <li class="item-xy"><a href="#">Test 1</a></li>
        </ul>
    </li>
    <li class="item-3 deeper parent">
        <a href="test.html">Test 3</a>
        <ul>
            <li class="item-xy"><a href="#">Test 1</a></li>
            <li class="item-xy"><a href="#">Test 1</a></li>
            <li class="item-xy"><a href="#">Test 1</a></li>
        </ul>
    </li>
    <li class="item-4"><a href="test.html">Test 4</a></li>
    <li class="item-5"><a href="test.html">Test 5</a></li>
</ul>

$("li.deeper ul").hide();
$("ul#submenu li.deeper").hover(function(event){
    var myClass = $(this).attr("class");
    var ulcl = myClass.replace("deeper parent","");
    event.stopPropagation();
    $("."+ulcl+" ul").slideToggle();
});   

It works but sometimes if you are near the li items with the mouse,
the child items start bubbling.
You can see it here:
http://jsfiddle.net/andrewwhitaker/ybVFj/

Can someon help me?

Thanks

  • 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-13T12:05:38+00:00Added an answer on June 13, 2026 at 12:05 pm

    It bubbles because when it begins to slide you get another mouseout event, this fires the toggle again. So, add some flag

    your construct is a bit strange, why instead of

    var myClass = $(this).attr("class");
    var ulcl = myClass.replace("deeper parent","");
    $("."+ulcl+" ul").slideToggle();
    

    not use

    if(!isSliding) {
        isSliding = true;
        $(this).find("ul").slideToggle(function(){isSliding = false;});
    }
    

    ?

    The code you referenced is different of the one you posted here.

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

Sidebar

Related Questions

I have a problem in my jquery code. I want to make a cascading
i am begginer to jquery and have a simple problem.. I want to make
I have 3 panels and I want to make drags on them. The problem
I have this problem: I want to generate a new source code file from
My problem has to do with PHP, jQuery and CSS. I want to make
I have a problem with jquery and a dynamic table. I want a click
I want to make a menu that.. does this: http://jsfiddle.net/8U9fy/1/ ( didnt want to
I have a problem with animations using jQuery on nested tables. I want to
I'm trying to make my first jQuery slider, and I have this code: $(#str).keyup(function(event)
i have this problem that i need to get the value of href and

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.