jQuery 重新计算可排序的放置点
我有一个与此回答的问题类似的错误: js/jQuery Drag'n'Drop,重新计算放置目标
如果用户可以在布局中进行可拖动的移动,并更改可放置的位置, 可以调用 $.ui.ddmanager.prepareOffsets 重置偏移量。这就是上面票证中的答案。
我有一个带有克隆助手的可排序对象,它仍然会在我的可放置对象上触发接收回调,即使它只适用于可拖动对象(接收回调有效)。所以看起来这个助手就像一个假的可拖动的东西一样运行,因为它可以交互但没有 .data('draggable')。
我是否需要显式地将可排序中的每个项目设为可拖动,或者是否有其他方法可以使用我错过的 $.ui.ddmanager.prepareOffsets ?
有关使用prepareOffsets的另一个示例,请查看: http://rubberflat.com/2010/06/refresh-jquery-ui-droppable-area-after-shifting-position/
I have a bug similar to this answered question:
js/jQuery Drag'n'Drop, recalculate the drop targets
If a user has a draggable move around the layout, and change the position of the droppable,
$.ui.ddmanager.prepareOffsets can be called to reset the offset. This is the answer in the above ticket.
I have a sortable with a cloned helper that still fires the receive callback on my droppable, even though it should only work with draggables ( receive callback works ). So it seems the helper is running like a fake draggable because it can interact but doesn't have .data('draggable').
Do I need to explicitly make each item in my sortable a draggable or is there another way to use $.ui.ddmanager.prepareOffsets that I missed?
For another example of using prepareOffsets check out: http://rubberflat.com/2010/06/refresh-jquery-ui-droppable-area-after-shifting-position/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在排序开始时,我确保可排序助手获取 ui.helper.draggable()
On sort start I make sure the sortable helper gets ui.helper.draggable()