在 iPad 上滚动
我有下一个代码:
> <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?
I have the next code:
> <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>
How can I scroll horizontally the content div when my finger is over the div that scrolls only vertically and I gesture like I want to scroll horizontally?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我能够捕获触摸事件并通过识别“单击”div 并计算拖动轨迹来滚动右侧 div。
有关触摸事件的更多信息:
https://developer.apple.com/库/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
滚动是用以下方法制作的:
http://demos.flesler.com/jquery/scrollTo/
I was able to catch the touch events and scroll the right divs by identifying "clicked" div and calculating the trajectory of the drag.
More infos about the touch events:
https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/HandlingEvents/HandlingEvents.html
Scrolling made with:
http://demos.flesler.com/jquery/scrollTo/
如果我正确地解释你的问题...你想用水平滚动来模拟鼠标滚轮。我猜这不是 ipad 的功能。如果你移动手指滚动到一个方向,如果可能的话它会这样做......但是当你溢出被隐藏时它会忽略它。我认为这对于某些网络代码来说是不可能的。我对这个问题的理解正确吗?
if i interpret your question right... you want to simulate the mousewheel with horizontally scroll. Thats not a feature of ipad i guess. if you move your fingers to scroll into a direction it will do that if possible... but as you overflow is hidden it will ignore it. i think this is not possible with some web-code. did i undestand that question right?