View Full Version : Is there this mouse event for a DIV Control?

03-02-2006, 10:40 AM

Does a DIV control(context menu) have attribute or events which can detect mouse-clicks outside of the control?

I read that there is an onclick event, div.attributes["onclick"], but the event is for mouse clicks within the control. Are there mouseclick events which can be detected outside of the control?

e.g When the user clicks anywhere on the page, the context menu will dissapear.

03-02-2006, 10:42 PM
You would have to trigger the event handler for the body and then test if the mouse is inside the div.