H5頁面嵌入安卓設備後,頁面長按導致App崩潰。
查了下資料,覺得可能是長按觸發了某些默認的事件,比如長按複製、長按選中、長按打開菜單等瀏覽器的一些事件,於是試着禁用掉長按事件,解決
*{
-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 {
-webkit-user-select:auto; /*webkit瀏覽器*/
}