且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

jQuery Ui:无法从Div中拖动元素到溢出

更新时间:2023-11-10 23:47:46

我通过使用辅助方法将项目附加到主体(因此它位于div之外)来解决了这个问题

I got around this by using a helper method to append the item to the body (so its outside the div)

$("#myitem").draggable({
helper: function() { return $(this).clone().appendTo('body').show(); }
});

不确定是否需要show(),我还必须提高z索引,但这取决于页面的其余部分.

Not sure if you need the show() and I also had to raise the z-index but it depends on the rest of your page.

菲尔