jQuery: Freezing/Disabling all events temporarily?

Posted by Legend on Stack Overflow See other posts from Stack Overflow or by Legend
Published on 2010-06-01T16:27:38Z Indexed on 2010/06/01 16:33 UTC
Read the original article Hit count: 177

Filed under:
|
|
|

I have the following usecase:

  • A div with some buttons
  • When the user clicks on a button, a popup is shown and the background div is faded out to 0.5 opacity

The problem is that when the popup comes in, the user is still able to click on the background buttons. At this point, I can remove the entire DIV temporarily but I don't want to do that. Is there anyway I can disable all the previously attached events and then add event handlers ONLY to the current popup? (I mean something like a close button should still work on a popup) Any suggestions?

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery