JQuery Mobile - html5+CSS 禁止IOS長按複製貼上實現
阿新 • • 發佈:2018-11-23
因為在移動端APP需要實現長按執行別的事件,但是在IOS系統有預設的長按選擇複製貼上,禁止此功能在網上找了很多資料,最終整理出目前最好的解決方法。實際測試,也並不是很理想,但是可能沒有更好辦法了!
/*設定IOS頁面長按不可複製貼上,但是IOS上出現input、textarea不能輸入,因此將使用-webkit-user-select:auto;*/ *{ -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,textarea { -webkit-user-select:auto; /*webkit瀏覽器*/ margin: 0px; padding: 0px; outline: none; }
原文: https://blog.csdn.net/qinyuhua93/article/details/53905506