If you don't mind using jQuery, there exists a Right-click Plugin that makes this much simpler.
Nick Presta
2010-08-01 20:20:32
If you don't mind using jQuery, there exists a Right-click Plugin that makes this much simpler.
Testing this in Firefox 3.6.4/Mac worked as expected:
document.onclick = function(e) {
var rightclick;
if (!e) e = window.event;
if (e.which) rightclick = (e.which == 3);
else if (e.button) rightclick = (e.button == 2);
alter(rightclick);
}
Perhaps you're not attaching the click handler correctly?