I’ve a main div of which inside I’ve some more divs. I want the inner divs to be draggable inside the main div and when saved, saves their positions.
Can anyone help me on how to save the positions? [Permanently, not just for the current session]
I’ve a main div of which inside I’ve some more divs. I want the
Share
You can do it with jQuery UI: http://jqueryui.com/demos/draggable/#constrain-movement
You can get the position of each div, fetching the left and top css attributes. You can see the jQuery documentation: http://api.jquery.com/position/ and use:
Finally, if you want to update some input you can do it adding a callback to the stop event of the draggable interaction of jQuery UI. Hope that helps!.