...

View Full Version : How to use jquery droppable for moving icons(div) in droppable and draggable div



whitehacker
07-17-2010, 09:53 AM
Hello,
I'm writing php file manager project, in which I want to make drag n drop move feature of file into file explorer which is also draggable.
I tried like this....
$(".fileexplorer").droppable({
accept: ".icon",
drop: function(){
$(ui.draggable).appendTo(".fileexplorer");
// I will write ajax method to move file in php

}
})
but I can't get dragged id by $(ui.draggable).attr("id") in above function and When I wan to drag (move) icon from fileexplorer div from main panel, it doesn't work, (I can't take it out again to main panel).

Spudhead
07-20-2010, 10:18 AM
Because it doesn't know what ui is.


drop: function(event, ui){
$(ui.draggable).appendTo(".fileexplorer");

UI reference (http://jqueryui.com/demos/droppable/#event-drop)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum