I am developing a website with Jquery-ui draggables. In the parent div block "container" there are many child draggables which allows user to freely move around the div block.
<div class="container">
<div class="draggable ui-widget-content" id="1">Table 1</div>
<div class="draggable ui-widget-content" id="1">Table 2</div>
...
</div>
I implemented a save function which saves the position of each div block as a json string. It stores the position of the draggables and their IDs. So it can be loaded with where they were at last time.
[{"id":"1","left":"256","top":"226"},{"id":"2","left":"256","top":"632"},{"id":"3","left":"1330","top":"226"},{"id":"4","left":"1330","top":"632"},{"id":"5","left":"818","top":"417"}]
Here's the problem:
I loaded the data from json. It turns out all the position is all wrong.
I recreated using JSFiddle to address the issue: https://jsfiddle.net/braveminds1823/wcmxL2bj/3/
After saving, loading the position from json

Edit: I know setting the position to absolute works, but since my website is responsive. The draggables will break out from the container and cover up the web content
