I have an html page with two div elements. One is on the complete left of the page and it has classname toolbox. Another is just on the right of toolbox and it has classname canvas. Inside toolbox, there is a square shaped element with classname node1. Its width and height are 50 pixels each. The following code makes it possible to drag the node1 from toolbox to canvas. As you can see, there is a variable named x which is a clone of node1. Just after node.helper.remove() I want to write code to find the coordinates of the left top of the clone. The coordinates should be with respect to the canvas. Could you tell me what code to write?
$(document).ready(function(){
$(".node1").draggable({
helper: 'clone', // cloning the node/icon.
cursor: 'move' // move with cursor.
})
$(".canvas").droppable({
drop: function(event, node)
{
var x = node.helper.clone();
x.draggable({
containment: '.canvas'
});
node.helper.remove();
}
});
});