从 PhoneGap iOS 应用程序中删除文本选择

Ale*_*rth 4 ios cordova

我试图找到一种方法来限制整个 PhoneGap 应用程序中的文本选择。有人知道这样做的方法吗?

Suh*_*has 6

这对你有用:-

<style type="text/css">
   *:not(input):not(textarea) {
   -webkit-user-select: none; /* disable selection/Copy of UIWebView */
   -webkit-touch-callout: none; /* disable the IOS popup when long-press on a link */
  }     
</style>
Run Code Online (Sandbox Code Playgroud)

使用java脚本:-

 document.documentElement.style.webkitTouchCallout = "none";
 document.documentElement.style.webkitUserSelect = "none";
Run Code Online (Sandbox Code Playgroud)


小智 5

html {
-webkit-user-select: none;
}
Run Code Online (Sandbox Code Playgroud)

css 代码中的这个小成分将发挥神奇的作用!