[英]JavaScript Disable “open”,“open new tab” and “copy” long press on anchor tag in iOS 8 safari
我試圖在iOS 8中長時間按下錨標簽上的“打開”,“打開新標簽”,“添加到閱讀列表”和“復制”選項。我嘗試使用-webkit-touch-callout:none
,它僅防止僅“保存圖像”選項。 我嘗試了以下代碼,但沒有用。 我不想使用pointer-events:none
,單擊錨標記后,我需要打開一個燈箱彈出窗口。 任何幫助表示贊賞
我嘗試了以下選項:
$('a').on("touchstart", function(e) {
e.preventDefault();
});
$('a').bind("touchstart", function(e) {
e.preventDefault();
});
在您的css文件中,嘗試以下操作:
* {
-webkit-touch-callout: none;
-webkit-user-select: none; /* Disable selection/copy in UIWebView */
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.