<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="author" content="
http://www.softwhy.com/" />
<title>蚂蚁部落</title>
<style type="text/css">
html,body{height:100%}
div{
width:150px;
height:50px;
background:#CCC;
}
</style>
<script type="text/javascript" src="mytest/jQuery/jquery-1.8.3.js"></script>
<script type="text/javascript">
$(document).ready(function(){
(function($){
$.fn.disableSelection=function(){
return this.attr('unselectable','on')
.css({'-moz-user-select':'-moz-none',
'-moz-user-select':'none',
'-o-user-select':'none',
'-khtml-user-select':'none',
'-webkit-user-select':'none',
'-ms-user-select':'none',
'user-select':'none'})
.bind('selectstart', false);
};
})(jQuery);
$(':not(input,select,textarea)').disableSelection();
})
</script>
</head>
<body>
<div id="thediv">蚂蚁部落</div>
<textarea></textarea>
</body>
</html>
如果您觉得本文的内容对您的学习有所帮助:
关键字:
jQuery