移动 Safari - 显示控制台?

发布于 2024-09-24 00:58:11 字数 137 浏览 0 评论 0原文

为了防止页面的默认滚动,我在正文上添加了“touchstart”事件的事件侦听器并调用 event.preventDefault() 这工作正常,但我现在无法访问调试控制台因为它需要页面拖动?还有其他人遇到过这个问题并想出解决方法吗?

To prevent the default scrolling of a page I'm adding an event listener for "touchstart" events on the body and calling event.preventDefault() This works fine but I now can't access the debug console as it requires a page drag? Has anyone else had this problem and come up with a work around?

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

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

发布评论

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

评论(2

寻找我们的幸福 2024-10-01 00:58:11

嗯,有趣。也许您可以将绑定的范围限制到页面的较小区域,比如说页面上的“内部 div”,而不是“外部 div”?然后,也许您可​​以在它们之间留出少量的空间以便调用控制台?

Hmm, interesting. Perhaps you can limit the scope of the bind to a less-encompassing region of the page, let's say an 'inner div' on the page, but not an 'outer div'? Then, perhaps you can leave yourself a small amount of margin between them for you to invoke the console?

空宴 2024-10-01 00:58:11

我建议在 url 中添加一个参数,您可以通过该参数重新激活滚动

i would suggest adding a parameter to the url by which you can reactivate scrolling

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