JQueryUI可拖动加上-webkit-overflow-scrolling隐藏拖动元素吗? [英] JQueryUI draggable plus -webkit-overflow-scrolling hides dragging elements?
问题描述
我有一个滚动div,可使用-webkit-overflow-scrolling:touch;
在iPad2上完美滚动.
I have a scrolling div that scrolls beautifully on iPad2 using -webkit-overflow-scrolling:touch;
.
在内部,我具有使用JQueryUI.draggable
和TouchPunch
的可拖动元素,以启用通过移动设备上的触摸进行拖动.
Inside, I have draggable elements using JQueryUI.draggable
and TouchPunch
to enable dragging via touch on mobile.
我非常接近它能够完美运行,但是我发现了一个问题.像这样设置div时,我的JQueryUI draggable helper
对象不会浮于其他所有对象之上.禁用-webkit-overflow-scrolling
时,它会正确浮动,但滚动时会断断续续.
I'm so close to having it work perfectly, but I've found an issue. With divs set up like this, my JQueryUI draggable helper
object won't float over-top everything else. With -webkit-overflow-scrolling
off, it floats properly, but scrolls choppy.
有办法同时兼顾两个方面吗?
Is there a way to have the best of both worlds?
这是一个JSBin,请使用iPad或iPhone查看该问题!
提前谢谢!
推荐答案
我知道了,我只需要使可拖动对象将助手添加到正文
I figured it out, I just needed to make the draggable append the helper to body
$(element).draggable({appendTo: 'body'});
这篇关于JQueryUI可拖动加上-webkit-overflow-scrolling隐藏拖动元素吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!