I managed to put something together that swaps the content of div’s.
The content however is also linked to an array that I’d like to be updated as well.
It suffices if only the first value in the array is updated.
I’ve tried something that comes close to the solution but only works partly JSFiddle
For some reason it only works for the element that has been dragged first and will than not work the other way.
All help is welcome.
According to the error message in the console each time an entry is dragged, the last line in that code appears to be causing the problem because id=“uldPopup” does not exist in the HTML.
With that line commented out the array will update each time.
In what way - when I commented out that line the array started switching the order back and forth as I swapped the two divs around with the rest of your code.
Hello megazoid, Thank you for replying.
It’s important that the ID’s of remain unchanged of all DIV’s (this because of other things that are going on in my program)
BTW your code sometimes fails to swap.
Can’t you use jQuery for that task?
It would be hundred times simplier and I can show you how to implement this without all that mess of events and handlers using jQuery UI