jQuery Plugin To Disable Element Selection On Webpage - selection.js

File Size: 4.03 KB
Views Total: 282
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   
jQuery Plugin To Disable Element Selection On Webpage - selection.js

selection.js is a super tiny jQuery plugin used to prevent user from selecting and copying html elements (text, images, etc) on web pages. Works with Firefox, Chrome, IE 8+, Opera and Safari.

How to use it:

1. Download the plugin and include the selection.js script on the web page. Make sure you first have jQuery library included.

<script src="//code.jquery.com/jquery-1.11.3.min.js"></script>
<script src="jquery.selection.js"></script>

2. The method to disable the selection.

$('element').disableSelection()

3. The method to enable the selection.

$('element').enableSelection();

This awesome jQuery plugin is developed by vinicius-stutz. For more Advanced Usages, please check the demo page or visit the official website.