In my IE extension under certain conditions I would like to capture mouse events at the document level but prevent HTML elements from receiving these captured events. By default an HTML element receives a mouse event first and then the event bubbles up to the document level. So cancelling the event at the document level does not have any effect.
I hope these information can help you to solve this problem.
Jesse Jiang [MSFT]
MSDN Community Support | Feedback to us
Get or Request Code Sample from Microsoft
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
No, you can't capture at the document level and prevent elements from receiving the event. You'll have to handle the event for each element.
> How can I prevent any other event listeners to fire after my own handling?
you can cancel bubbling of the event with a cancelBubble property
below is an example.
- Edited by Malobukv Saturday, December 17, 2011 7:58 AM