开发者

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜