在頁面樣式內加入
*{
-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;
}
在添加完這段代碼后,在IOS 上會有問題的,這個時候你會發現input 框無法正在輸入了內容了;
造成這個原因就是 -webkit-user-select:none; 這個屬性造成的。
解決這個方法 就是 在css 文件中同時設置一下input/texteare 的屬性,如下所示:
input , texteare{
-webkit-user-select:auto;
}