vue 移动端iOS阻止图片长按事件

1、来个透明 div  覆盖到img上

.imgView{

      width: 7.02rem;

      height: 5rem;

      position: absolute;

      top: 0;

      left: 0;

      z-index: 110;

//阻止代码

 -webkit-touch-callout: none;

      -webkit-user-select: none;

      -moz-user-select: none;

      -ms-user-select: none;

      user-select: none;

      -webkit-user-drag:none;

    }

    #img {

      z-index: 10;

      width: 6.54rem;

      height: 4.6rem;


//阻止代码
-webkit-touch-callout: none;

      -webkit-user-select: none;

      -moz-user-select: none;

      -ms-user-select: none;

      user-select: none;

      -webkit-user-drag:none;

    }

2 、       pointer-events: none; 禁止点击,加这个就可以了。第一种上面的阻止代码没用,就是加的遮罩才起作用

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容