How do I get the coordinate position after using jQuery drag and drop? I want to save the coordinate to a database, so that next time I visit, the item will be in that position. For example, x: 520px, y: 300px?
EDIT:
I am PHP and mysql programmer :)
Is there any tutorial out there?
Had the same problem. My solution is next:
None of the above worked for me.
Here's my solution- works great:
(Based partly off solution given here: https://stackoverflow.com/a/10429969/165673)
I just made something like that (If I understand you correctly).
I use he function position() include in jQuery 1.3.2.
Just did a copy paste and a quick tweak... But should give you the idea.
I would start with something like this. Then update that to use the position plugin and that should get you where you want to be.
If you are listening to the dragstop or other events, the original position should be a ui parameter:
Otherwise, I believe the only way to get it is:
Where draggable is the object you are dragging. The second version is not guaranteed to work in future versions of jQuery.
This worked for me: