Search code examples
javascriptjqueryjquery-uidraggable

Draggable element disappears in div


Trying to create a draggable div, but instead of it dragging into the droppable div and snapping into it, the draggable div just disappears when dragged. As seen here the div begins to disappear and still appends. I thought it might be a containment issue

$('.sorting').draggable({containment: 'parent', cursor:'pointer'});

When I changed the containment to parent from window the draggable div stays within as seen here. Not understanding why the draggable div disappears and does not enter the droppable the box like I want. I am sure there is something I am not understanding or seeing that probably needs to be pointed out. I would also be very appreciative to know why this happens and any other tips one may have.


Solution

  • Your draggable ul element disappears because of the overflow attribute of the .mousescroll class.

    Replacing the css with

    .mousescroll{
        float: left;
    }
    .mousescroll:hover {
    }
    

    fixes your problem.