移動端禁止長按複製提示框
當e.prenventDefault()無效時試試這個
*{
-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框也會被禁止輸入,記得加上這個
input{ -webkit-user-select: auto; }
相關推薦
移動端禁止長按複製提示框
當e.prenventDefault()無效時試試這個 *{ -webkit-touch-callout:none; /*系統預設選單被禁用*/ -webkit-user-select:none; /*webkit瀏覽器*/ -khtml-user-select:none; /*早
移動端禁止長按圖片彈出選單和禁止文字選擇
禁止長按圖片彈出選單 img{ pointer-events: none; -webkit-user-select: none; -moz-user-
移動端禁止長按圖片彈出系統功能列表和禁止文字選擇
1.禁止圖片長按 img{ pointer-events: none;/*禁用滑鼠*/ } 2.禁止文字選擇 .no-select{ -webkit-user-select:none;
vue2.0移動端自定義性別選擇提示框
這篇文章主要是簡單的實現了vue2.0移動端自定義性別選擇的功能,很簡單但是經常用到,於是寫了一個小小的demo,記錄下來。 效果圖: 實現程式碼: <template> <div class="app">
移動端列表長按後上下拖動進行排序
簡述:移動端列表長按後,然後可以上下拖動進行排序,主要使用了基於h5 sortTable,然後使用了touch相關事件實現,僅支援移動端。效果圖:長按下後拖動過程中的效果,如果不長按,只能上下滑動:程式碼實現解析:首先看html的程式碼:<!DOCTYPE html&g
移動端阻止長按文字出現選中效果
移動端有時候會需要長按儲存圖片,但當頁面中有文字時,長按會出現選中文字時的框,使用者會感覺很奇怪。 禁止目標文字被選中 //在需要禁止選中的文字所在位置加上以下css樣式 .txt { -webkit-touch-callout:none; -webkit-user-sele
移動端 jquery 長按觸發移動事件
長按觸發移動事件,可以用於手機介面上返回導航圖示 等等 將程式碼拷貝到本地,進行測試 在手機端測試,或者通過谷歌瀏覽器F12 測試 增加了對長按時間的判斷,區分單擊事件和長按事件 <!DOCTYPE html> <html> <
移動端h5長按刪除效果
貼上到html即可看到效果,用於移動端長按刪除 <body> <div class="butlong" style="position:relative;"> <input type="button" value="長按刪除" class
移動端web 禁止長按彈出的選單 Safari
這是一個系列,記錄我前端開發常用的程式碼,小常識,有些是參考網上程式碼,(講的可能有點爛,求不要打臉,嚶嚶嚶~~)送給那些需要的人。可以相互交流,喜歡的加我吧。 Wx: Lxp911221
禁止長按微信頁面出現默認選擇彈框
light fun blog menu info alt 右擊 con src 長按微信中打開的h5頁面默認會有彈框,如圖: 如果我們不想出現這個,可以加: document.oncontextmenu=function(e){ e.preventDefault
JQuery Mobile - html5+CSS 禁止IOS長按複製貼上實現
因為在移動端APP需要實現長按執行別的事件,但是在IOS系統有預設的長按選擇複製貼上,禁止此功能在網上找了很多資料,最終整理出目前最好的解決方法。實際測試,也並不是很理想,但是可能沒有更好辦法了! /*設定IOS頁面長按不可複製貼上,但是IOS上出現input、textarea不能輸入,因此將使用-w
微信小程式——小實現(禁止頁面滾動、長按複製)
1. 禁止頁面滾動 對於小程式某些一屏的頁面,特別是全屏的swiper,並不希望頁面在豎直方向上可以滾動。 實現方式: 在需要禁止滾動頁面的json中加入: "disableScroll": true
禁止IOS長按複製貼上
/*設定IOS頁面長按不可複製貼上,但是IOS上出現input、textarea不能輸入,因此將使用-webkit-user-select:auto;*/ *{ -webkit-touch-ca
html5+CSS 實現禁止IOS長按複製貼上功能
/*設定IOS頁面長按不可複製貼上,但是IOS上出現input、textarea不能輸入,因此將使用-webkit-user-select:auto;*/*{-webkit-touch-callout:
html5 在移動端禁止頁面縮放和選中複製
最近在開發過程中,遇到客戶提出移動端禁止頁面縮放和禁止長按選中複製等屬性,除在安卓/ios原生中加入相應許可權外,html5頁面也可以作相應的設定。 <meta content="width=device-width, initial-scale=1.0, maxim
移動端Android軟鍵盤遮住輸入框解決!
res set pan area app tar span lac row 在使用vue的情況下,在輸入框中添加 <textarea class="textarea" @click="isAndroid" :maxlength="30" :rows="1" plac
移動端軟件盤遮擋輸入框問題
監聽事件 如果 第三方 代碼 element string function 滾動scroll read 第一、首先解決軟鍵盤影響布局的問題: 軟鍵盤彈出會改變瀏覽器可視區域的高度,安卓會觸發window.resize事件,ios不會觸發,所以如果頁面元素的布局是以窗口
移動端頁面輸入法擋住input輸入框的解決方法
寬高 定位 tex 百分比 address inpu cor strong lin 1,寬高用了百分比或者vw/vh布局的,input輸入框的最外層父容器的可用JS動態設置為當前窗口的寬高(防止輸入法的彈出令頁面變形) 2,最外層父容器用了fixed定位的,不要用top:0
移動端禁止滾動
mov chm event 事件 log win func clas window 1、h5界面在移動端打開,點擊btn後禁止界面的滾動,采用ontouchmove事件,原理是重寫ontouchmove方法 禁止: window.document.ontouchmove =
javascript移動端禁止頁面滑動的解決方案
lse ipad str oid 發現 hid 滾動條 touch roi 1 前言 移動端網頁,發現ios平臺的iphone或者ipad,網頁可以上下左右移動,而Android版則不會。僅作為記錄使用。 2 代碼 var mo=function(e){e.prevent