PDA

View Full Version : Alternative drag-n-drop script.



eikhorsholm
08-12-2008, 08:42 AM
I've tried to search the web for a solution, but without any luck :-(

I have an array (in order) with div's and there coordinates (to place them on my page).

Is there any way to take one of the div's, drag it onto one of the other div's, release it and then they switch place.

So it should not place itself before or after the div it is dragged over (as every drag-n-drop script does that I've found) but switch place with it.

eikhorsholm
08-12-2008, 08:44 AM
I've used this drag-n-drop script a lot and tried to recode it to do as I wish. But I haven't come nearby any solution.
http://www.webreference.com/programming/javascript/mk/column2/3.html

Don't know if the link above will be any help, but I just wanted to show you what I've tried to use before...

codeexploiter
08-12-2008, 09:47 AM
Have you tried this one

http://www.walterzorn.com/dragdrop/dragdrop_e.htm

Hope this helps.

eikhorsholm
08-12-2008, 10:17 AM
I actually have seen that one, but it doesn't have features such as dropTargets and so on. So it really doesn't satisfy my problem.

It only provides features to drag items (and copy)... Almost without any respect for other elements on the page.

But thanks for you reply! Hope to see other solutions that might solve my problem.

mmurph211
08-12-2008, 01:46 PM
You could start with this and perhaps modify it:
http://www.matts411.com/webdev/creating_draggable_html_element_panes

It's not a lot of code