Update: disableTestSelect
Introduction ¶
Received a kind comment from dehneg the other day, he pointed out the disableTextSelect plugin has no way of enabling the text select after it’s been disabled, pretty large thing for me to neglact. So here is an updated version with enableTextSelect.
Requirements ¶
- jQuery - Core that the plugin runs with
Compatibility ¶
So far the plugin has been tested in windows using the following browsers.
- IE 6, 7
- FF 1.5, 2, 3
- Opera 9
- Safari 3
Usage ¶
HTML
1 2 3 | <p class="disableSelection"> this text can't be selected. </p> |
Javascript
1 2 3 | $(function() { $('.disableSelection').disableTextSelect(); // and enableTextSelect() to re-enable it again }); |
Downloads ¶
jquery.disable.text.select.jsjquery-disable.text.select.example.htm
jquery.disable.text.select.pack.js
jQuery Disable Text Select Plugin
Introduction ¶
While making html elements dragable and using them as clickable areas I noticed some little annoyances, mainly the area being selected. This occurs if the user happends to double click, or if the user clicks some element to expand an item then quickly clicking it again to collapse it. The text would become selected. I personally found this very annoying.
So I’ve written a pretty basic jQuery plugin to help with the problem.
Requirements ¶
- jQuery - Core that the plugin runs with
Compatibility ¶
So far the plugin has been tested in windows using the following browsers.
- IE 6, 7
- FF 1.5, 2, 3
- Opera 9
- Safari 3
Usage ¶
HTML
1 2 3 | <p class="disableSelection"> this text can't be selected. </p> |
Javascript
1 2 3 | $(function() { $('.disableSelection').disableTextSelect(); }); |
Downloads ¶
jquery-disable.text.select.example.htmjquery.disable.text.select.js (1.16 KB)
jquery.disable.text.select.pack.js (1.07 KB)