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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T19:27:32+00:00 2026-06-11T19:27:32+00:00

My menus work like this: each menu item (e.g., Menu Item One below) is

  • 0

My menus work like this: each menu item (e.g., Menu Item One below) is in a <td> in a table nested inside ANOTHER <td>. That outer <td> has some onclick event handler (here called “processMenuClick()”).

<td onClick="processMenuClick(<item-dependent-arguments>);">
    <table>
        <tr>
            <td class="innermenuitem">Menu Item One</td>
       </tr>
    </table></td>

Under certain conditions I wish to prevent the menu from responding to clicks. In order to test how this will work, I make two buttons. One applies event.stopPropagation to each <td> of class “innermenuitem” like so:

<button onclick="javascript:stopit()">Test the disable menu functionality</button>

<script type="text/javascript">
function stopit()
{
    $("td.innermenuitem").click(function(event)
    {
        event.stopPropagation();
    })
}
</script>

This seems to work great. When I click the button, the menu stops responding to the clicks. But now say I want to re-enable the menu. The click handler is still undisturbed in the outer <td>. So I want my second button to DISABLE the stopPropagation that I’ve applied to the inner <td>. Does that make sense? If so, how is it done?

Note: Note that the above should allow me to disable the menu and re-enable it without having to rebind the outer <td> to its handler. This is important because the arguments that are passed to “processMenuClick()” are only known on the server. I would have to figure out a way to recall them through some kind of postback if I had to rebind the handler. But I figure since all I’ve done is stop bubbling the events up from the inner <td>, assuming there’s a way to UNDO this (and permit events to bubble up again) I should be golden. But reading other threads it seems like stopPropagation is used for just one event, not like I am thinking of it, which is basically like a “status” on the <td>. Can somebody set me straight? (And hopefully solve the problem I’ve tried carefully to describe here?) Thanks.

Paragram

  • 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-11T19:27:33+00:00Added an answer on June 11, 2026 at 7:27 pm
    function startIt(){
         $('td.innermenuitem').off('click');
    }
    

    stop it should bind with the on method to make this as simple as possible.

    function stopIt(){
        $('td.innermenuitem').on('click', function(event){
           event.stopPropagation();
        });
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On this site : mecanomedic.com , the menu template work fine in normal desktop
Cant get this script to work with my menu really have tried everything any
So I'm trying to adapt this Dropdown menu on Joomla the styles work great
I would like to blink my menu text. I have this code, but it
I have a menu which has an item for each value in an enum.
I have an unordered list I'm using for a menu. Each item has a
I dont what is going on but I have this menu set like this
I'm doing a tree view menu, the html is something like this: <ul id=sec1>
I have code that looks something like this: <HierarchicalDataTemplate DataType={x:Type local:SomeType} ItemsSource={Binding SomeOtherItems} >
I have a menu made of an li list. Each li item needs to

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.