开发者

get xy coordinates on html5 drop event

开发者 https://www.devze.com 2023-02-17 22:24 出处:网络
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

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

精彩评论

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