Problem using array of jQuery elements - or problem having to reload jQuery elements?

Problem using array of jQuery elements - or problem having to reload jQuery elements?


My task requires saving x/y positions of multiple draggable/resizable
divs in a page layout. When I click the Save button the page posts
back (because the server has to save to the database). When the page
reloads all the jQuery draggable/resizable divs are gone so I have to
reload them. Because I have to reload them (in mass quantity) I would
like to use an array (using code similar to these snippets):
function SomeOtherFunction() {
for (z = 0; z <= 1; z++)
AttachInnerDiv(divInner[z], divOuter);
}
function AttachInnerDiv(divInner, divOuter) {
//among other things like setting divInner event handlers, this
function does...
divOuter.appendChild(divInner);
var id = new String();
id = "#" + divInner.id;
$(id).draggable().resizable();
}
Also note that divOuter is draggable.
If I use individual variables for each divInner then it appears to
work, but the array craps. Using the array, all the divInner's appear
as children of divOuter, but they are not draggable().resizable(). I
would like to use an array because of the nature of this task. The
number of divInner's is variable so I can't hardcode 100+ variables
for this purpose (very ugly).
Any ideas how to accomplish this with an array?
Or any ideas how I might avoid having to reload the jQuery elements
after each save?
Thanks,
bluetrain