Drag and drop Clone Coding



function loadData(){
   
        dragRevert = true;
        CountOfAnswers1 = 0;
   
            $(".dragItem").draggable({containment: "#dragBg", helper: "clone", revert: "invalid"});

        $(".drop>div").each(function(){
            $(this).droppable({
                drop:function(event, ui){
                   
                    if($(this).html() == ""){
                         $(this).append($(ui.draggable).clone());
                        }
                }
            });
        });
       
        if(is_touch_device()){
          init();
          }
   
}

No comments:

Post a Comment