防止放大镜出现

问题描述:

当我选择一个文本并单击鼠标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?

我没有显示自己的弹出窗口的全部答案(这需要一些JS技巧),但是要摆脱那个放大镜,将此添加到您的CSS:

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.