手机
当前位置:查字典教程网 >编程开发 >Javascript教程 >禁止选中文字兼容IE、Chrome、FF等
禁止选中文字兼容IE、Chrome、FF等
摘要:复制代码代码如下:$(el).attr('unselectable','on').css({'-moz-user-select':'-moz...

复制代码 代码如下:

$(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等】相关文章:

JavaScript中的parse()方法使用简介

文字幻灯片

jQuery实现html表格动态添加新行的方法

让文字在页面上90度,180度翻转

js实现鼠标移到链接文字弹出一个提示层的方法

javaScript中slice函数用法实例分析

JS面向对象(3)之Object类,静态属性,闭包,私有属性, call和apply的使用,继承的三种实现方法

node.js微信公众平台开发教程

用 或 || 来兼容FireFox

获取对象

精品推荐
分类导航