禁止选中文字兼容IE、Chrome、FF等
$(el).attr('unselectable','on')
.css({'-moz-user-select':'-moz-none',
'-moz-user-select':'none',
'-o-user-select':'none',
'-khtml-user-select':'none', /* you could also put this in a class */
'-webkit-user-select':'none',/* and add the CSS class here instead */
'-ms-user-select':'none',
'user-select':'none'
}).bind('selectstart', function(){ return false; });
根据上面分析 可以设置 你需要禁止选中文字区域的 css。如:
.table {
text-align: center;
vertical-align:middle;
height: 39px;
overflow: hidden;
moz-user-select: -moz-none;
-moz-user-select: none;
-o-user-select:none;
-khtml-user-select:none; /* you could also put this in a class */
-webkit-user-select:none;/* and add the CSS class here instead */
-ms-user-select:none;
user-select:none;/**禁止选中文字*/
}
您可能感兴趣的文章:
禁止选中文字兼容IE、Chrome、FF等
css禁止鼠标选择文本代码
jquery获取颜色在ie和ff下的区别示例介绍
jQuery 禁用右键菜单的简单代码
javascript兼容IE与FF的写法
js右下角与漂浮广告代码(兼容ie,ff,ie8,ie7)
CSS3禁止网页中文本被选中代码
js下IE与FF浏览器兼容的函数
css 图片垂直居中(兼容各主流浏览器,含IE6/IE7)
JavaScript键盘事件深入解析