
November 10th, 2010, 09:08 AM
|
|
Registered User
|
|
Join Date: Nov 2010
Posts: 2
Time spent in forums: 13 m 38 sec
Reputation Power: 0
|
|
|
oncontextmenu window.event = null
I am trying to create a custom right-click menu in javascript, and I can't get the coordinates of the mouse when using oncontextmenu in IE7. I have it working fine in firefox, but in IE the window.event comes back as null.
Code:
checkbox.oncontextmenu = function(event) {
if (event == null)
event = window.event;
alert("event: "+event);
alert("window.event: "+window.event);
/* Handle right-click */
};
I understand that IE does not pass along the event, but is there any reason why both of my alerts (specifically window.event) print null? 
Last edited by jmac726 : November 10th, 2010 at 09:10 AM.
Reason: Fixed CODE tag
|