【笔记】阻止h5长按出现系统默认的复制菜单

在h5页面,在某些场景下我们是不希望用户长按出现系统默认的菜单的,

可以通过以下css实现,还要考虑给input开放允许

*{//禁止h5长按调起系统菜单
    -webkit-touch-callout:none; /*系统默认菜单被禁用*/
    -webkit-user-select:none; /*webkit浏览器*/
    -khtml-user-select:none; /*早期浏览器*/
    -moz-user-select:none;/*火狐*/
    -ms-user-select:none; /*IE10*/
    user-select:none;
}
input,textarea {
    -webkit-user-select:auto; /*webkit浏览器*/
    -khtml-user-select:auto; /*早期浏览器*/
    -moz-user-select:auto;/*火狐*/
    -ms-user-select:auto; /*IE10*/
    user-select:auto;
}
发布了22 篇原创文章 · 获赞 1 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_42618289/article/details/103887196
今日推荐