您的位置:首页 > Web前端 > CSS

文本选择问题: css & js

2016-05-08 08:51 459 查看
CSS:

/*Disable browser selection*/
.disableselect
{
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-ms-user-select:none;
-webkit-touch-callout:none;
-webkit-tap-highlight-color: rgba(0,0,0,0);
}
.enableselect {
-webkit-user-select: text;
-moz-user-select: text;
-ms-user-select:text;
user-select:all;
}


JS:

var clearSlct= "getSelection" in window ? function(){
window.getSelection().removeAllRanges();
} : function(){
document.selection.empty();
};
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: