Dragging between lists
I am working on creating a script that allows a user to drag and drop between multiple sortable lists. I've got the dragging working fine, and I have a good plan for the dropping so that's sorted out.
However, it turns out that when the user decides to click and drag a list item, I want to replace the list item with a dummy holder (no problem there got that worked out) and temporarily attach the list item to its own dummy ul item (so the user has the impression that he is grabbing the list item). Then when the user drops the list item, I'll insert it into the appropriate location in one of the lists (or move it back to the beginning if they drop it in the middle of nowhere).
The problem I'm having is in determining the exact location to place the dummy UL so that the user doesn't feel like the list item is jumping around when they click on it.
Also, it occurs to me that I will need to solve essentially the same problem when determining the drop location for the list item, since I plan on comparing the page location of the moving list item with the page location of the static list items.
So basically, this boils down to, how to do I find the exact page location of a LIST element within a UL element?
This is going to be very dependent on the html structure and css settings. Do you have a demo/test page so we can see the html/css?
My first thought is that you'll need something like xPageX and xPageY - but they are not foolproof. Much depends on the html/css.
Thanks for your interest. Anyway, my very early demonstration page is up at http://www.unitorganizer.com/sortable.
The problem will be, I won't have too much control over the structure of the lists since they will be generated by a wide variety of different database configurations (since I'm writing this as part of a module for a large CMS community). What I expect is that I will have multiple lists, each with multiple child lists.
However, I do have control over the CSS, so if I need to make some changes to make this work, then I'm able to do so.
xPageX and xPageY
These functions work great but something screwy is happening when I move the selected list element to the new ul, it seems to screw up my place holder list element, and I have NO idea why, I can't see why there would be any conflict at all.
I'll see what I'm missing, but if you see it, that would be appreciated, note that the placeholder shows up completely fine before I do the move.