How can i catch the correct click position?
I have a self-made context-menu that I want to raise on the click position.
The click is on a DOMelement in a jQueryUI.dialog()
object.
When i try, i gives me the wrong (for my use) coordinates.
Javascript:
$("a").on("contextmenu", function(eve){
$("#contextmenu").show().css({
left: eve.pageX,
top: eve.pageY
});
});
<div class="im-the-dialog">
<div class="60% width">some content</div>
<div>
<ul>
<li>
<a class="clicked">click</a>
</li>
</ul>
</div>
<div class="the context menu">some links</div>
</div>
how can i fix it?