我编写了一个JQuery插件,但它有一些问题。我想通过按住Shift键并单击表格行来选择表格中的多行,但当我选择某个浏览器时,其默认样式会添加到所选文本中。我没有足够的名气来发布照片。Please click here to see the picture。
我怎么才能去掉那些风格呢?
发布于 2013-07-25 16:47:02
您可以在css中禁用用户选择-
table{
-webkit-user-select:none;
-moz-user-select:none;
user-select:none;
}发布于 2013-07-26 15:05:03
最后,我得到了一个解决这个问题的方法,方法是防止文本被selected.code,如下所示
if (typeof document.onselectstart!="undefined")
document.onselectstart=new Function ("return false");
else{
document.onmousedown=false;
document.onmouseup=true;
}但是,我从来没有能够选择文本。
https://stackoverflow.com/questions/17853067
复制相似问题