I have this element, which is animated in the mouseup function, but right now it works with both left and right buttons. Is there a way to use the button on the left ?
mouseup
$(document).ready(function() { $("div").mouseup(function() { top: "-101%" }); });
You can check which mouse button was pressed using e.which ( 1 is primary, 2 is middle, and 3 is secondary):
e.which
1
2
3
$(document).ready(function() { $("div").mouseup(function(e) { if (e.which != 1) return false; // Stops all non-left-clicks ... }); });