Here an example http://jsfiddle.net/naqbq/
How do I grab current position for x
and y
after re-position the image?
You can obtain the top, and lef:
$('selector').draggable({
drag: function(event, ui) {
ui.position.top; // .left
// or
$('selector').position().top; // current position of an element relative to the offset parent
$('selector').offset(); // retrieves the current position relative to the document.
}
})