javascript - JQuery UI 拖入可排序不滚动

标签 javascript jquery html css jquery-ui

我正在尝试将 jquery ui draggablesortable 一起使用,因为我可以将新元素从 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/

相关文章:

javascript - 从文件系统在 webbrowser 控件中加载 jQuery

javascript - 使用 javascript 内联更改颜色

javascript - 使用 Javascript 将 iso 时间戳转换为日期格式?

javascript - 当我拖动一个点时更新数据

javascript - 页面加载后动态添加 jquery datepicker

javascript - 在 jQuery 日期选择器上监听 onChange?

jquery - 根据数量动态布置固定大小的 div

javascript - 防止div碰撞

javascript - firefox 不尊重 float 方向的 javascript 更改

jquery - 使用 HTML5 和 jQuery 在单击按钮时获得类似相机的快门闪光效果