防止放大镜出现

发布于 2024-11-15 08:18:48 字数 119 浏览 0 评论 0原文

我想在选择文本并单击鼠标 1-2 秒时显示我自己的弹出窗口。我可以让它在 FF/Chrome 中工作,但在 iphone/ipad 的 safari 中,当我点击文本有时会出现放大镜,如何防止该放大镜并显示我自己的弹出窗口?

I want to show my own popup when a text is selected and mouse is clicked for 1-2 seconds. I can get it working in FF/Chrome but in iphone/ipad's safari when I tap a text for sometime a magnifier appears, how to prevent that magnifier and show my own popup?

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

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

发布评论

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

评论(1

夜清冷一曲。 2024-11-22 08:18:49

我没有显示您自己的弹出窗口的所有答案(这需要一些 JS 黑客攻击),但要摆脱放大镜,只需将其添加到您的 CSS 中:

body {
  -webkit-touch-callout: none;
}

...或者只是添加到您想要的元素禁用放大镜。

I don't have all the answers for showing your own popup (that'll require some JS hacking), but to get rid of that magnifying glass, just add this to your CSS:

body {
  -webkit-touch-callout: none;
}

...Or just add to the element you want to disable the magnifier on.

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