You can check to see which mouse button was pressed using e.which
(1
is primary, 2
is middle and 3
is secondary):
$(document).ready(function() {
$("div").mouseup(function(e) {
if (e.which != 1) return false; // Stops all non-left-clicks
...
});
});