javascript - How can I write the JQuery equivalent of .click for middle click? -
A user clicks on an action when I want to set a fire.
. Click capture only the left click (right? Or at least this is a case in my experiments on Firefox).
I know that I just do a mousedown / mouseup and find out which button was clicked, but I'm not sure That I have to lose from various compatibility / security / etc. Features of .click
What can I write to get the .middleclick function closer to the behavior similar to .click ?
My experiments are
// This does not work for mid-click or right click $ ("a"). Click (function (e) {e.preventDefault (); Alert (E.J.);}); // This works for all three types of clicks (although for the right click fwiw // it does not prevent the relevant menu from coming into the FF document. AddEventListener ("click", function (e) {e.preventDefault (); Alert (E.J.);}, True);
Instead Try using the mouseup, click
$ ("a"). Mouseup (function (e) {e.preventDefault (); Alert (E.H.H.); });
Comments
Post a Comment