Retrieve the position of a clicked button?
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...
&开发者_Python百科lt;script type=text/javascript>
$( "#dM1").click( function(event) {
dropMenu('dropMenu1', event.pageX);
});
</script>
$(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.
精彩评论