This article mainly introduces the implementation of html5 and CSS to prohibit the long press copy and paste function in IOS. It has a certain reference value. Now I share it with you. Friends in need can refer to it
because on the mobile side The APP needs to implement long press to execute other events, but the iOS system has the default long press option to copy and paste. I have found a lot of information on the Internet. The editor will share the solution with you. Let’s take a look.
Because the mobile APP needs to implement long press to execute other events, but in the iOS system, there is a default long press Select copy and paste to disable this function. I found a lot of information on the Internet and finally sorted out the best solution so far.
The project is an APP, which has been adapted to many mobile phones, so you can use it with confidence.
/*设置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; }
The above is the entire content of this article. I hope it will be helpful to everyone’s study. For more related content, please pay attention to the PHP Chinese website!
Related recommendations:
How to use HTML5 and jQuery to pop up the creative search box layer
html5 and css3 dynamic bubble button Implementation
The above is the detailed content of HTML5 and CSS implement disabling IOS long press copy and paste function. For more information, please follow other related articles on the PHP Chinese website!