jQuery UI drop event of droppable fires on sortable

后端 未结 3 1516
暗喜
暗喜 2020-12-20 02:28

I have a list of elements that can be dropped into a list of (existing) sortables. When a droppable element is dropped into the sortables, I want to modify the element. I do

3条回答
  •  盖世英雄少女心
    2020-12-20 02:46

    perhaps this can help :

    See this fiddle for code, I change it:

    http://jsfiddle.net/penjepitkertasku/CxpMn/34/

    $('#sortable').sortable();
    $('#sortable').droppable({
        drop: function(ev, ui){
            $(ui.draggable).html('
    ' + ui.draggable.text() + '
    '); } }); $('#draggables li').draggable({ connectToSortable: '#sortable', helper: 'clone', revert: 'invalid', cursor: 'move' });

提交回复
热议问题