I have a load of divs that area ll floated left so they sit next to eachother in rows that fill a page. I want to change the order they are in programmatically and still have them floated.
I have a piece of JS that I wrote which grabs the offset of each box, gives them a fixed position (using the offset so they stay in place), and then animates them to one of the other offsets. My problem is that I now need to convert them back from absolute positioning back to floated positioning. Doing this obviously reverts them back to how they were originally.
What I need to know is whether it is possible to set the index of each div - so I could associate an offset with an index and update each divs offset and index so that when they're floated they stay in place. Is there a way to set DOM elements' index using jQuery?