移动端有时候会需要长按保存图片,但当页面中有文字时,长按会出现选中文字时的框,用户会感觉很奇怪。
禁止目标文字被选中
//在需要禁止选中的文字所在位置加上以下css样式
.txt {
-webkit-touch-callout:none;
-webkit-user-select:none;
-khtml-user-select:none;
-moz-user-select:none;
-ms-user-select:none;
user-select:none;
}