html - 在 iPad 上滚动

标签 html css 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?

最佳答案

我能够捕捉到触摸事件并通过识别“点击”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/

相关文章:

HTML.TextAreaFor - 删除仅供显示的 html 标签

css - ISO 8 忽略元视口(viewport)并自动使网站在 iphone 6 中响应

javascript - 物化 css slider 不工作

iphone - 如何使用otool

javascript - 修复 Mailchimp 选择加入功能 - 从测试到生产

javascript - 单击时编辑 HTML 文本

javascript - 单击按钮时关闭模态窗体并打开一个新窗体

html - 创建下拉菜单?

iphone - xcode 构建 svn 号插入不起作用

iphone - 释放自定义单元格类应用程序中的对象时崩溃