我正在尝试将 jquery ui draggable
和 sortable
一起使用,因为我可以将新元素从 draggable 放入 sortable,然后对元素进行排序排序。
包含 sortable 的 div 具有固定高度,如果元素太多,则设置为滚动。我的问题是,当我将一个新元素拖到可排序项中时,滚动不可用,就像我在可排序项中移动元素时一样。拖动时也禁用鼠标滚轮滚动。
我的 Fiddle
当我将新元素拖入 div 时,有没有办法通过将新元素移动到 div 底部或使用鼠标滚轮在 div 中启用滚动?
感谢您的帮助。
最佳答案
你可以使用
scroll: true
查找方法
文档 http://jqueryui.com/draggable/#scroll
Automatically scroll the document when the draggable is moved beyond the viewport. Set the scroll option to true to enable auto-scrolling, and fine-tune when scrolling is triggered and its speed with the scrollSensitivity and scrollSpeed options.
关于javascript - JQuery UI 拖入可排序不滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36304821/