Jquery Mouse Coordinates and Disable Mouse Click

by GOKILAVANI 2014-05-30 09:24:58

Disabling Right Mouse Click

To disable right click on the web browser, we can use the following code:

$(document).ready(function(){
$(document).bind("contextmenu",function(e){
return false;
});
});

 

Detect Current Mouse Coordinates

To detect the current mouse coordinates in the web browser in use. To do this, we can use the below  code

$(document).ready(function() {
$().mousemove(function(e)
{
$('# MouseCoordinates ').html("X Axis Position = " + e.pageX + " and Y Axis Position = " + e.pageY);
});
<DIV id=MouseCoordinates></DIV>
});

 

1313
like
0
dislike
0
mail
flag

You must LOGIN to add comments