javascript - Drag and drop function matching images -
i made dropspot drag , drop function in div has image + dropspot unfortunately function doesnt work :( wrong ?
$(function() { $( ".right img" ).draggable ({ revert: "invalid", helper: 'clone' }); $( "#dropspot0" ).droppable({ tolerance: 'fit', drop: function( event, ui ) { $(ui.draggable).clone().appendto($("#dropspot0")); } }); });
check jsfiddle
i think jqueryui library not included in jsfiddle.
$(function() { $( ".right img" ).draggable ({ revert: "invalid", helper: 'clone' }); $( "#dropspot0" ).droppable({ tolerance: 'intersect', drop: function( event, ui ) { $(ui.draggable).clone().appendto($("#dropspot0")); } }); });
Comments
Post a Comment