本文介绍了在ctrl中单击Firefox中的td时删除怪异的边框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我按ctrl +单击td时,该td将具有怪异的边框.它仅在Firefox中发生.有人可以帮我吗?非常感谢.
When I ctrl+ click on a td, that td will have weird border. It only occur in firefox. Would some one help me with it? Thank you very much.
这是实时演示 http://jsbin.com/banofehisu/edit ?html,css,js,输出
只需按Control并单击您将看到的td.
Just press control and click on the td you'll see it.
推荐答案
添加此行:
*{
-moz-user-select: none;
}
或者,您可以只在表中应用此规则.
Or, you may just apply this rule in table.
根据@tushar注释,如果您仍希望选择文本,则可以使用如下的jquery:
As per @tushar comment, if you want your text still be selected then you may use jquery like this:
$('table').on('mousedown', function(e) {
if (e.ctrlKey) {
e.preventDefault();
}
});
这篇关于在ctrl中单击Firefox中的td时删除怪异的边框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!