有没有办法在ipad上的safari中锁定水平滚动?

发布于 2024-10-06 16:54:04 字数 279 浏览 0 评论 0原文

有谁知道是否有办法使用 javascript/css/html 锁定 ipad 上 safari 中的水平滚动?

我有以下元标记,试图修复视口

<!--  Mobile viewport -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

任何帮助将不胜感激!

Does anybody know if there is a way to lock the horizontal scroll in safari on ipad using javascript/css/html?

I have the following meta tag in place in an attempt to fix the viewport

<!--  Mobile viewport -->
  <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">

Any help would be appreciated!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

叹倦 2024-10-13 16:54:04

如果有人感兴趣,我通过添加

event.stopPropagation();
event.preventDefault();

touchmove 事件来解决这个问题。

In case anyone is interested, I managed to solve this problem by adding

event.stopPropagation();
event.preventDefault();

to the touchmove event.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文