Tag Archive

jQuery, check witch mouse button had been pressed

Published on August 25, 2010 By admin

The .click is great, but witch button had been pressed? $(document).click(function(e) {    if ((e.button == 0)  && (e.button == 1)){       // was the left button pressed       alert(‘clicked’);    }    if (e.button == 3){       // was the right button pressed       alert(‘click’);   [...]