jQuery Sortable and Droppable

前端 未结 6 2048
抹茶落季
抹茶落季 2020-12-04 22:28

I want to have a list that is sortable, but I also want the elements in that list to be droppable to the divs I have defined as droppable. I can\'t seem to find a way to do

6条回答
  •  鱼传尺愫
    2020-12-04 22:53

    Was able to get a similar end result by making the each of the target DIVs their own sortables.

    I then, via connectWith, made all of the sortables able to connect and share draggables.

    Something like:

    var connects = '#main_sortable, div.target';
    $('#main_sortable').sortable({ connectWith: connect });
    $('div').sortable({ connectWith: connect} );
    

提交回复
热议问题