Reputation: 10879
Well, everything is on the question. I have a clickEvent on one of my button and i want to retrieve the position of this button when i click on it.
Actually i retrieve the position event.pageX but it's not really what i want...
<script type=text/javascript>
$( "#dM1").click( function(event) {
dropMenu('dropMenu1', event.pageX);
});
</script>
Upvotes: 0
Views: 299
Reputation: 4992
$(this).position() will have information regarding the object that was clicked within your event handler relative to the offset parent. $(this).offset() has positioning information relative to the document.
Upvotes: 2