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

从PhoneGap iOS应用程序中删除文本选择,ios,cordova,Ios,Cordova,我正在试图找到一种方法,能够在整个PhoneGap应用程序中限制文本选择。有人知道怎么做吗 html { -webkit-user-select: none; } css代码中的这个小元素将发挥神奇的作用 这将对您有用:- <style type="text/css"> *:not(input):not(textarea) { -webkit-user-select: none; /* disable selection/Copy of UIWebView */

我正在试图找到一种方法,能够在整个PhoneGap应用程序中限制文本选择。有人知道怎么做吗

html {
-webkit-user-select: none;
}

css代码中的这个小元素将发挥神奇的作用

这将对您有用:-

<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>

在iOS 9中有一个bug使得
-webkit用户选择:无不工作。有一个插件可以解决这个问题


多亏了弗雷德里克·韦斯伯格(Frederik Wessberg)

似乎是一个复制品:我将此响应与@Suhas-webkit touch callout一起使用,效果非常好。。。两个都投…谢谢这解决了它。因为插件没有那么多,所以你可能只想复制实现。
 document.documentElement.style.webkitTouchCallout = "none";
 document.documentElement.style.webkitUserSelect = "none";