开发者

Restricting the drop area with jQuery UI draggable()

开发者 https://www.devze.com 2023-03-24 19:58 出处:网络
jquery: $(\'#divDroppable div\').draggable({ appendTo: \"div.mainContainer div\", revert: true, containment: $(\"div.mainContainer > div\" ),

jquery:

$('#divDroppable div').draggable({
    appendTo: "div.mainContainer div",
    revert: true,
    containment: $("div.mainContainer > div" ), 
    helper: "clone"
    //drop: handleCardDrop
    //cursor: "move"
    //snap: 'div.mainContainer div'
});

How do I restrict the dropped item to div.mainContainer > div? Otherwise, it should revert to the original place. The helper class is also not worki开发者_StackOverflowng properly.

0

精彩评论

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