HTML5微信长按图片不会弹出菜单的解决方法

http://newmiracle.cn/?p=1017

https://segmentfault.com/q/1010000005088048

"contextmenu"事件,可以禁止长按的事件。

https://stackoverflow.com/questions/12304012/preventing-default-context-menu-on-longpress-longclick-in-mobile-safari-ipad


<div ontouchstart = "return false;" id="t"> 测试div </div>

也是可以的

<style type="text/css">
*:not(input):not(textarea) {
  -webkit-user-select: none; /* disable selection/Copy of UIWebView */
  -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
}       
</style>

If you want disable only anchor button tag use this:

a {
  -webkit-user-select: none; /* disable selection/Copy of UIWebView */
  -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
}
能解决IOS上的问题,但Android上长按还是会有菜单
 
原文地址:https://www.cnblogs.com/zhu-shixin/p/7193051.html