I'm using a WinMove function to make divs with the class ibox-title movable, but I dont know how to make the users computer save the divs positions in a cookie/localStorage so the divs will be saved in the spot where the user placed them. There are multiple pages and multiple divs on each page so it would be DRY to have a function for each div but I also dont know how to make something like this dynamic because I have very little experience with javascript/jquery, and no experience with cookies/localStorage.
jsfiddle: https://jsfiddle.net/at38xkav/1/
Function that lets the user move the divs around on the page
function WinMove() {
var element = "[class*=col]";
var handle = ".ibox-title";
var connect = "[class*=col]";
$(element).sortable(
{
handle: handle,
connectWith: connect,
tolerance: 'pointer',
forcePlaceholderSize: true,
opacity: 0.8
})
.disableSelection();
}
A sample of what each div will include on any given page
<div class="row">
<div class="col-lg-6">
<div class="ibox">
<div class="ibox-title">
<h5>Element 1</h5>
</div>
<div class="ibox-content"></div>
</div>
</div>
Thanks! :)