Rhys Rhys -4 years ago 111
Javascript Question

Jquery Draggable - Maintain Position on browser refresh

My html and css is changed every 5 minutes vi a shell script and then the browser refreshes to update page to reflect changes.

I have added Jquery draggable to allow users to reposition div's but I am limited to using client side coding only as the server doesn't support PHP, JSP etc..

Is it possible to maintain div positions on browser reload, without server side code?

Answer Source

You could give web storage a go. Won't work on older browsers, but assuming that this is just an aesthetic nicety it will take care of the majority of your users. The gist of how it would work is on every move, you'd write a position array to a key value, and on load you'd call back the values to set initial positions.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download