javascript - Is it possible to capture the scroll wheel click -


i've written code, when user clicks on link (i'm using jquery's .click()), modal popup telling them they're being redirected different site. works fine normal left click, however, clicking link using middle mouse button open in different tab loads page straight away rather showing modal. ideally i'd show them modal too, after timer finishes open in new tab them.

is possible capture click too?

try this, help

$("yourtag").on('mousedown', function(e) {     if( (e.which == 1) ) {      alert("left button");    }if( (e.which == 3) ) {      alert("right button");    }else if( (e.which == 2) ) {       alert("middle button");     }    e.preventdefault(); }).on('contextmenu', function(e){  e.preventdefault(); }); 

Comments

Popular posts from this blog

javascript - Jquery show_hide, what to add in order to make the page scroll to the bottom of the hidden field once button is clicked -

javascript - Highcharts multi-color line -

javascript - Enter key does not work in search box -