| 1068 |
rajveer |
1 |
/**
|
|
|
2 |
* .disableTextSelect - Disable Text Select Plugin
|
|
|
3 |
*
|
|
|
4 |
* Version: 1.1
|
|
|
5 |
* Updated: 2007-11-28
|
|
|
6 |
*
|
|
|
7 |
* Used to stop users from selecting text
|
|
|
8 |
*
|
|
|
9 |
* Copyright (c) 2007 James Dempster (letssurf@gmail.com, http://www.jdempster.com/category/jquery/disabletextselect/)
|
|
|
10 |
*
|
|
|
11 |
* Dual licensed under the MIT (MIT-LICENSE.txt)
|
|
|
12 |
* and GPL (GPL-LICENSE.txt) licenses.
|
|
|
13 |
**/
|
|
|
14 |
|
|
|
15 |
/**
|
|
|
16 |
* Requirements:
|
|
|
17 |
* - jQuery (John Resig, http://www.jquery.com/)
|
|
|
18 |
**/
|
|
|
19 |
(function($){if($.browser.mozilla){$.fn.disableTextSelect=function(){return this.each(function(){$(this).css({"MozUserSelect":"none"})})};$.fn.enableTextSelect=function(){return this.each(function(){$(this).css({"MozUserSelect":""})})}}else{if($.browser.msie){$.fn.disableTextSelect=function(){return this.each(function(){$(this).bind("selectstart.disableTextSelect",function(){return false})})};$.fn.enableTextSelect=function(){return this.each(function(){$(this).unbind("selectstart.disableTextSelect")})}}else{$.fn.disableTextSelect=function(){return this.each(function(){$(this).bind("mousedown.disableTextSelect",function(){return false})})};$.fn.enableTextSelect=function(){return this.each(function(){$(this).unbind("mousedown.disableTextSelect")})}}}})(jQuery)
|