[英]JQueryUI draggable plus -webkit-overflow-scrolling hides dragging elements?
I have a scrolling div that scrolls beautifully on iPad2 using -webkit-overflow-scrolling:touch;
我有一个滚动div,它使用-webkit-overflow-scrolling:touch;
在iPad2上完美-webkit-overflow-scrolling:touch;
. 。
Inside, I have draggable elements using JQueryUI.draggable
and TouchPunch
to enable dragging via touch on mobile. 里面,我有使用可拖动的元素JQueryUI.draggable
和TouchPunch
启用通过触摸移动拖拽。
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. 通过这样的div设置,我的JQueryUI draggable helper
对象不会浮于其他所有对象之上。 With -webkit-overflow-scrolling
off, it floats properly, but scrolls choppy. 随着-webkit-overflow-scrolling
关闭,它会正常浮动,但-webkit-overflow-scrolling
断断续续。
Is there a way to have the best of both worlds? 有没有办法让两全其美?
Here's a JSBin, please view using an iPad or iPhone to see the problem! 这是一个JSBin,请使用iPad或iPhone查看该问题!
Here's an EDITing view of the JSBin 这是JSBin的编辑视图
Thanks in advance! 提前致谢!
I figured it out, I just needed to make the draggable append the helper to body 我想通了,我只需要使可拖动对象将助手添加到身体
$(element).draggable({appendTo: 'body'});
This JS Bin still works for posterity. 此JS Bin仍然适用于后代。 Try this on iPad 在iPad上尝试
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.