possible duplicate:
jquery: detect if middle or right mouse button clicked, if so, this:
how show alert box says "middle mouse button clicked" when click on text, or dom element? want able differentiate between middle mouse , normal right click using jquery/javscript.
i did refer this: jquery: detect if middle or right mouse button clicked, if so, this:
and modified js fiddle this: http://jsfiddle.net/zaglp/29/
but seeking alternative "live()" function.
$(document).bind('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(); }).bind('contextmenu', function(e){ e.preventdefault(); });
Comments
Post a Comment