jQuery可排序和自动滚动 [英] JQuery Sortable and automatic scrolling

查看:91
本文介绍了jQuery可排序和自动滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使JQuery Sortable正常工作,但遇到了一个轻微的可用性问题.

I am trying to get JQuery Sortable to work but I have run into a slight usability problem.

我要排序的列表很大(大约200个项目).如果用户尝试将顶部项目向右拖动到底部,则当该项目到达屏幕可见部分的底部时,页面将滚动少量,然后停止.要触发更多的向下滚动,您必须以圆周运动将鼠标移动到该项目到达底部为止.

The list that I am trying to sort is quite large (about 200 items). If the user tries to drag the top item right to the bottom, once the item reaches the bottom of the visible part of the screen, the page scrolls a tiny amount, then stops. To trigger more downward scrolling, you have to move the mouse in circular motions about until the item reaches the bottom.

有什么方法可以在鼠标拖动项目并自动向下滚动屏幕时跟踪其位置?

Is there any method of tracking the position of the mouse while it is dragging an item and automatically scrolling the screen down?

推荐答案

我来看看滚动, scrollSensativity和scrollSpeed选项.

您可以执行以下操作:

$("#sort").sortable({ scroll: true, scrollSensitivity: 100 });

$("#sort").sortable({ scroll: true, scrollSpeed: 100 });

甚至

$("#sort").sortable({ scroll: true, scrollSensitivity: 100, scrollSpeed: 100 });

这篇关于jQuery可排序和自动滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆