首页 > Web开发 > 详细

文本选择问题: css & js

时间:2016-05-08 09:04:28      阅读:236      评论:0      收藏:0      [点我收藏+]

CSS:

 1 /*Disable browser selection*/
 2 .disableselect
 3 {
 4     -webkit-user-select: none;
 5     -moz-user-select: none;
 6     user-select: none;
 7     -ms-user-select:none;
 8     -webkit-touch-callout:none;
 9     -webkit-tap-highlight-color: rgba(0,0,0,0);
10 }
11 .enableselect {
12     -webkit-user-select: text;
13     -moz-user-select: text;
14     -ms-user-select:text;
15     user-select:all;
16 }

 

JS:

1 var clearSlct= "getSelection" in window ? function(){
2  window.getSelection().removeAllRanges();
3 } : function(){
4  document.selection.empty();
5 };

 

文本选择问题: css & js

原文:http://www.cnblogs.com/zsk526/p/5469762.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!