Home > Web Front-end > HTML Tutorial > The mouse does not allow you to select text in a certain area of ​​the webpage_html/css_WEB-ITnose

The mouse does not allow you to select text in a certain area of ​​the webpage_html/css_WEB-ITnose

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-24 11:39:33
Original
1298 people have browsed it

1. Add styles to elements -webkit-user-select:none; -moz-user-select:none; -ms-user-select:none; user-select:none;

2. ie6-ie9 needs to add the following js

a. //The text cannot be selected
var oDrag = document.getElementsByClassName("ard-adv");
for(var i =0; i
i ) >b. //The entire webpage

 document.body.onselectstart = document.body.ondrag = function(){

  return false;

 }

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template