+ 4
How to make html page not selectable
7 Antworten
+ 4
For other browser exept chrome and opera.
* {
-webkit-touch-callout: none; /* iOS Safari */
-webkit-user-select: none; /* Safari */
-khtml-user-select: none; /* Konqueror HTML */
-moz-user-select: none; /* Firefox */
-ms-user-select: none; /* Internet Explorer/Edge */
user-select: none; /* Non-prefixed version, currently
supported by Chrome and Opera */
}
+ 5
<!DOCTYPE html>
<html>
<head>
<style>
* {
user-select: none;
}
</style>
<title>Page Title</title>
</head>
<body>
Some text
</body>
</html>
+ 4
Using JQuery
<!DOCTYPE html>
<html>
<head>
<title>Page Title</title>
<script src="https://code.jquery.com/jquery-3.1.1.js"></script>
</head>
<body>
Hello World
<script>
$(function() {
$("body").on("selectstart",function(e){
e.preventDefault();
})
});
</script>
</body>
</html>
+ 3
Brent Meeusen thank you 🙂
this library makes life easier
+ 3
in css:
user-select:none;
+ 1
5667ce7f99078110265cec8b75482e4ea7055780 its works thanks :)