Retrieving X & Y position of jQuery element

jquery

Solution

Mate, you should read the whole page on a documentation:

All callbacks receive two arguments: The original browser event and a prepared ui object, view below for a documentation of this object (if you name your second argument 'ui'):

- ui.draggable - current draggable element, a jQuery object.

- ui.helper - current draggable helper, a jQuery object

- ui.position - current position of the draggable helper { top: , left: }

- ui.offset - current absolute position of the draggable helper { top: , left: }

droppable jQuery manual

$(".portletPlaceHolder").droppable({
    drop: function (evt, ui) {
        var offset = ui.offset;
        console.log(offset.left + "x" + offset.top);
    }
});

Problem

I need to retrieve the X & Y position of an element once its dropped, how can I implement this ? I think I need to use the droppable callback : ``` $(".portletPlaceHolder").droppable({ drop: function( event, ui ) { //... } }); ```

Original source