Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Jul 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    How to use jquery droppable for moving icons(div) in droppable and draggable div

    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).

  • #2
    Senior Coder Spudhead's Avatar
    Join Date
    Jun 2002
    Location
    London, UK
    Posts
    1,856
    Thanks
    8
    Thanked 110 Times in 109 Posts
    Because it doesn't know what ui is.

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


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •