Capturing clicks even when stopPropagation has been called (ie by 3rd party code)?

Posted by josh on Stack Overflow See other posts from Stack Overflow or by josh
Published on 2012-06-29T21:00:23Z Indexed on 2012/06/29 21:16 UTC
Read the original article Hit count: 130

I want to detect any click that happens on a page (to close a custom context menu). I'm using jQuery and trying to do

$(document).click(function(){ ...close my context menu ... });

However, I'm using some code that calls evt.stopPropagation() in the click handlers for certain elements on the page, and those clicks aren't making it up to my top-level handler. Is there any way of capturing those clicks? Can be jQuery or not jQuery, as long as it works cross-browser.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery