Take a look at this:
Javascript - Event properties[
^].
Value for right mouse button is 2, although note that it recommends using
mousedown
or
mouseup
events rather than click.
Here is a sample from the page showing right click detection:
function doSomething(e) {
var rightclick;
if (!e) var e = window.event;
if (e.which) rightclick = (e.which == 3);
else if (e.button) rightclick = (e.button == 2);
alert('Rightclick: ' + rightclick);
}
Attach method like this to div and inplace of alert call your function1()