tags:

views:

43

answers:

2
+1  A: 

If you don't mind using jQuery, there exists a Right-click Plugin that makes this much simpler.

Nick Presta
A: 

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?

roryf
Edited OP with more code.
Firstmate