简体   繁体   中英

Get Position of Drag & Drop Element

i am using the following code: http://www.html5canvastutorials.com/kineticjs/html5-canvas-drag-and-drop-a-group-with-kineticjs/ for Drag & Drop.

My question is: How can i get the actual position (x,y) of a group after being dragged and dropped?

You can use events of kinetic objects - http://www.html5canvastutorials.com/kineticjs/html5-canvas-path-mouseover/ In your case - 'dragend'.

group.on('dragend',function(){
    console.log(group.getPosition());
});

example: http://jsfiddle.net/lavrton/xEsDZ/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM