Is there any way to find the co-ordinates of a right click event on a div element as I have to set context menu based on the position of click.
Any help and suggestion will be appreciated. Thanks.
You can try:
$('div').on('contextmenu', function (e) {
console.log(e.pageX);
console.log(e.pageY);
});
And for whole page:
$('div').on('contextmenu', function (e) {
console.log(e.clientX);
console.log(e.clientY);
});