且构网

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

jQuery UI可拖动和页面滚动(在移动设备上)

更新时间:2023-10-24 22:57:04

万一有人需要这样的:

使用draggable()的handle选项可以解决问题。
例如,如果我有一个宽度为500px的div,我可以插入另一个(透明)div,它在右边对齐(例如)并且宽度为250px。然后我将最后一个div设置为可拖动div的句柄。

The problem can be solved by using the "handle" option of draggable(). For example, if I have a div with a width of 500px, I can insert another (transparent) div inside it aligned to the right (for example) and with a width of 250px. Then I set this last div as the handle of the draggable div.