javascript - jQuery droppable not working on absolute positioning -
i have div divided 6 grids. grids using absolute positioning placement.
for reason jquery droppable not working on absolute divs.
can tell me whats wrong code?
i created jsfiddle here show current code.
this jquery part.
$(".ui-draggable").draggable({ helper: 'clone', cursor: 'move', tolerance: 'fit', stack: '.ui-draggable', revert: "invalid" }); $(".ui-droppable").droppable({ accept: ".ui-draggable" });
it seems working fine, try this
$(".ui-draggable").draggable({ helper: 'clone', cursor: 'move', tolerance: 'fit', stack: '.ui-draggable', revert: "invalid" }); $(".ui-droppable").droppable({ accept: ".ui-draggable", drop: function( event, ui ) { alert('dropped'); } });
you'll see drop event fires correctly
are expecting behavior?
if want picture stay drop it, use
$(".ui-draggable").draggable({ stack: '.ui-draggable', revert: "invalid" });
Comments
Post a Comment