My javascript app uses both mousewheel (jquery plugin) event and left and right click events:
$(document).mousewheel(function(event, delta) {
if (delta < 0) {
swipeLeft(nextLink);
return false;
} else if (delta > 0) {
swipeRight(prevLink);
return false;
}
});
$("#div")
.on('contextmenu', function(ev) {
if (ev.which == 3) {
ev.preventDefault();
swipeRight(prevLink);
}
})
.mousedown(function(ev){
if(ev.which == 1) {
swipeLeft(nextLink);
return false;
}
});
$('#div').click(function(ev){
if (ev.which == 1) {
swipeLeft(nextLink);
return false;
}
});
I want middle click have normal behaviour, i.e. not being interpreted as a mouse wheel event, but the delta value is always 1 when I middle-click.
Is there a way to isolate middle click from mouse wheel turn?
Does the order the mousewheel and click events are defined matter?