简体   繁体   English

JQueryUI可拖动加上-webkit-overflow-scrolling隐藏拖动元素吗?

[英]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.draggableTouchPunch启用通过触摸移动拖拽。

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上尝试

Here's the code editing version 这是代码编辑版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 iOS:-webkit-overflow-scrolling:触摸和滚动 - iOS: -webkit-overflow-scrolling:touch and scrollTop -webkit-overflow-scrolling打破绝对定位 - -webkit-overflow-scrolling breaks absolute positioning 以编程方式停止-webkit-overflow-scrolling - Programmatically halt -webkit-overflow-scrolling -webkit-overflow-scrolling:自动; 在触控装置上无法运作 - -webkit-overflow-scrolling: auto; not working on touch devices 移动网络:-webkit-overflow-scrolling:触摸与位置冲突:已修复 - Mobile web: -webkit-overflow-scrolling: touch conflicts with position:fixed scrollLeft通过-webkit-overflow-scrolling自动返回到旧位置: - scrollLeft automatically returning to old position with -webkit-overflow-scrolling: touch 如何在react组件上设置-webkit-overflow-scrolling内联样式 - How to set -webkit-overflow-scrolling inline style on react component 任何方式应用'webkit-overflow-scrolling:touch'内嵌javascript? - Any way to apply 'webkit-overflow-scrolling: touch' inline with javascript? -webkit-overflow-scrolling:触摸导致jQuery动态更改不显示? - -webkit-overflow-scrolling: touch causes jQuery dynamic changes to not show? scrollTop不能与-webkit-overflow-scrolling一起使用:touch - scrollTop doesn't work with -webkit-overflow-scrolling: touch
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM