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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:59:34+00:00 2026-05-27T07:59:34+00:00

I have a ul li sublist with toggle. ul li a.trigger ul.sub_list li li

  • 0

I have a ul li sublist with toggle.

ul
   li a.trigger
       ul.sub_list li
   li
   li

Event – click.

When I click the a.trigger, ul.sub_list will show.
To hide ul.sub_list. I need to click the a.trigger or html element.

The problem is how to stop html from hide() ul.sub_list when user click ul.sub_list items.

example: http://jsfiddle.net/zYgfr/

this is like facebook notification.

  • 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-27T07:59:34+00:00Added an answer on May 27, 2026 at 7:59 am

    Add this:

    $(".sub_list a").click(function(event){
           event.stopPropagation();
    });
    

    The concept is that, by default, when an element is clicked, it propagates up through the DOM.

    So when the link is clicked, eventually after propagation to each parent, the event will reach the HTML root element, triggering any event handlers along its path.

    To stop that, we call event.stopPropagation().

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

Sidebar

Related Questions

I have this jQuery snippet: $(function() { $(ul > li).hover(function() { $(this).find(ul).stop(true, true).animate({opacity: 'toggle'},
I have a List<String> and i need to take a sublist out of this
I have the below implementation for the sublist algorithm. Problem: Given 2 lists, determine
I have written a JAXB mapping that stored a sublist inside a root element
I have a list of lists (sublist) that contains numbers and I only want
I have a menu in which only one item has a sublist. Here is
What's the best way to get a sublist of things? I have two tables:
I have a list/sublist structure in my LaTeX document. By default, the sublist is
I Have written such a code below and I will pass two lists to
sorry but I do not have the actual code with me, but I will

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.