开发者

jquery drag & drop functionality not working sometime

开发者 https://www.devze.com 2023-04-01 19:19 出处:网络
this is my code for doing drag and drop functionality. i use jquery pugins core js 1.5 and jquery ui-1.7.1

this is my code for doing drag and drop functionality. i use jquery pugins core js 1.5 and jquery ui-1.7.1

 $('#middle li').draggable({

    helper: function () {
        var selected = $('#middle input:checked').parents('li');
        if (selected.length == 0) {
            selected = $(this);
        }
        var container = $('<div/>').attr('id', 'middle');
        container.append(selected.clone());
        return container;
    }
});
$("#left div").droppable({
    drop: function (event, ui) {
        //$(this) = Folder Name where item is being dropped
        foldername = $(this).text();
        var fileid = $(ui.helper.children()).text();     
    }
});

now middle is my div where i am draging li element and drop in left div using that co开发者_开发技巧de i am getting text of both drag item and drop item......

Problem:- 1. this functionality working only when page refresh why? 2. how i get text of multiple item when i am drag and drop multiple item also count how many item drag and drop at a time


I solved my problem.

Issue is my jquery load after jqueryUI so drag&droup not working.

So any way load jqueryUi after jquery 1.5 or any other version

0

精彩评论

暂无评论...
验证码 换一张
取 消