jQuery-Ui: Cannot drag object outside of an accordion

前端 未结 5 1327
别跟我提以往
别跟我提以往 2020-12-11 04:11

I have a draggable object inside of an accordion widget. When dragging it, it\'s constrained its parent, the accordion element. I\'ve tried to use the \'containment\' option

5条回答
  •  自闭症患者
    2020-12-11 04:43

    For those of you looking for a complete example, take a look at the Shopping Cart example on the jQuery UI demo. This is a droppable example, but illustrates exactly what was being asked (Dragging a element outside of an accordion).

    $(function() {
            $( "#catalog" ).accordion();
            $( "#catalog li" ).draggable({
                appendTo: "body",
                helper: "clone"
            });
    });
    

    And continue on from there.

提交回复
热议问题