Created
April 21, 2018 02:36
-
-
Save tun/cdb523e01e51a445d34ae66cc4b4cfd3 to your computer and use it in GitHub Desktop.
jquery mouse clicks
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$('body').mousedown(function(event) { | |
switch (event.which) { | |
case 1: | |
alert('Left Mouse button pressed.'); | |
break; | |
case 2: | |
alert('Middle Mouse button pressed.'); | |
break; | |
case 3: | |
alert('Right Mouse button pressed.'); | |
break; | |
default: | |
alert('You have a strange Mouse!'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment