移動端有時候會需要長按保存圖片,但當頁面中有文字時,長按會出現選中文字時的框,用戶會感覺很奇怪。
禁止目標文字被選中
//在需要禁止選中的文字所在位置加上以下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;
}