开发者

get xy coordinates on html5 drop event

with html5 drag and drop, how do i get the x and y position of where the item was dropped on the drop event? i need to dynamically create and display an image and a popup at that point...not using the canv开发者_StackOverflow社区as


Use the standard clientX and clientY properties:

function onDrop(ev) {
    window.alert( ev.clientX + ',' + ev.clientY);
    ev.stopPropagation();
    return false;
}
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜