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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:53:45+00:00 2026-05-21T16:53:45+00:00

On a dynamic page I wish to disable and later re-enable sections. Visually they

  • 0

On a dynamic page I wish to disable and later re-enable sections. Visually they are grayed out, but need to prevent users from playing with the section until later.

For elements using on-click triggers, would like to:

  • save the current on-click trigger in an attribute
  • remove the current on-click trigger
  • add trigger that no-defaults and no-propagates

to re-enable:

  • get rid of the no-default trigger
  • re-apply the trigger previously saved
  • clear attribute where it was saved

From replies so far:

conjecture: using pure JavaScript html5 level, without delegation or some other external mechanism, it is impossible to extract the on-click trigger from an element.


Solution

was very tempted by delegations – and was defeated by not being able to prevent memory leaks. ended up doing it anyway, with a simple gc to do the job.

extends (add|remove)EventListener with (add|push|pop|remove)PopableEventListener, making code change trivial. allows me to push and pop listeners to any level – wonderful for form context changes other than merely enable/disable.

source: http://code.google.com/p/chess-spider/source/browse/http/scripts/popable.js

doc: http://code.google.com/p/chess-spider/wiki/PopableEventListener?ts=1303738300&updated=PopableEventListener

Editorial

Contrary to most I have seen, the ability to access listeners in the dom would be a significant benefit; besides being able to sanely disable re-enable, the ability to coerce them into a different scope would be incredibly useful.

  • 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-21T16:53:45+00:00Added an answer on May 21, 2026 at 4:53 pm

    The best way to handle hundreds of triggers is to use event delegation.

    You then examine each click for if it matches your trigger. If it is the child of a disabled section you discard the click.

    A jQuery implementation would be something like as follows:

    $('.trigger', document.body).live('click', function(e) {
      var target = $(e.target);
      if (target.parents('.disabled').length > 0) {
        // handle click
      }
    });
    

    Obviously you can use other frameworks or plain JavaScript as suits you best.

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

Sidebar

Related Questions

How would one display any add content from a dynamic aspx page? Currently I
Our SEO team would like to open up our main dynamic search results page
Embedded custom-tag in dynamic content (nested tag) not rendering. I have a page that
I wish to create a dynamic RSS feed to represent my site's content. Currently,
(Summary: My users need to be able to edit the structure of their dynamically
I have dynamic page under {foreach} tag something like this. <div id=c1> {foreach} <input
I am working on dynamic page where height of the page is concern. So,
how do i make my grdivew page more dynamic than hardcoded upto 5 pages?,
I have a dynamic web page that after clicking a link, I insert a
I have a highly dynamic single page interface where various user events trigger new

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.