newbie_86
newbie_86

Reputation: 4610

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 canvas

Upvotes: 5

Views: 3106

Answers (1)

robertc
robertc

Reputation: 75707

Use the standard clientX and clientY properties:

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

Upvotes: 1

Related Questions