You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
46 lines
1.2 KiB
46 lines
1.2 KiB
14 years ago
|
/**
|
||
|
* .disableTextSelect - Disable Text Select Plugin
|
||
|
*
|
||
|
* Version: 1.0
|
||
|
* Updated: 2007-08-11
|
||
|
*
|
||
|
* Used to stop users from selecting text
|
||
|
*
|
||
|
* Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/)
|
||
|
*
|
||
|
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
||
|
* and GPL (GPL-LICENSE.txt) licenses.
|
||
|
**/
|
||
|
|
||
|
/**
|
||
|
* Requirements:
|
||
|
* - jQuery (John Resig, http://www.jquery.com/)
|
||
|
**/
|
||
|
(function($) {
|
||
|
if ($.browser.mozilla) {
|
||
|
$.fn.disableTextSelect = function() {
|
||
|
return this.each(function() {
|
||
|
$(this).css({
|
||
|
'MozUserSelect' : 'none'
|
||
|
});
|
||
|
});
|
||
|
};
|
||
|
} else if ($.browser.msie) {
|
||
|
$.fn.disableTextSelect = function() {
|
||
|
return this.each(function() {
|
||
|
$(this).bind('selectstart', function() {
|
||
|
return false;
|
||
|
});
|
||
|
});
|
||
|
};
|
||
|
} else {
|
||
|
$.fn.disableTextSelect = function() {
|
||
|
return this.each(function() {
|
||
|
$(this).mousedown(function() {
|
||
|
return false;
|
||
|
});
|
||
|
});
|
||
|
};
|
||
|
}
|
||
|
})(jQuery);
|