11月7日
家快修前台页面切图时遇到问题,有一个按钮,用户需要长按它,但是显示在微信里面的网页,长按会出现复制的菜单,造成用户体验不流畅。
解决方法:
<1>.把如下代码加在css样式里面
*{
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
-o-user-select:none;
}
此方法对安卓系统不适用,苹果系统适用
<2>.把如下代码加在按钮标签里面
ontouchstart = "return false;"
个人比较喜欢第二种,也建议使用第二种,安卓和苹果系统都可以用
萌萌哒 ^.^