我有下一个代码:
> <div class="scroller" style="width: 100%; height: 300px; overflow:
> auto; overflow-y: hidden;">
> <div class="content" style="height: 100%; width: 2500px;">
> <div id="vScrollDiv" style="width: 500px; height: 100%; overflow: auto; color: #fff; display: inline-block">
> Content that makes div overflow verticaly
> </div>
> <div style="width: 1900px; height: 100%; color: #000; display: inline-block">
> Content that makes "scroller" div overflow horizontaly
> </div>
> </div>
当我的手指悬停在只能垂直滚动的 div 上并且我做出我想水平滚动的手势时,如何水平滚动内容 div?
最佳答案
我能够捕捉到触摸事件并通过识别“点击”div 并计算拖动轨迹来滚动正确的 div。 有关触摸事件的更多信息: https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html 滚动制作: http://demos.flesler.com/jquery/scrollTo/
关于html - 在 iPad 上滚动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9375727/