Firefox 上奇怪的蓝色边框

2023-12-26

请看一下这段代码

http://www.jsfiddle.net/tt13/5CxPr/21 http://www.jsfiddle.net/tt13/5CxPr/21

On Firefox it shows strange blue border when you select multiple row by pressing ctrl button but on Chrome it doesn't.

使用最新的火狐浏览器10.0.2。

这是与浏览器相关的错误吗?


这是由于选择了文本 - 本机浏览器行为。

You can observe the same issue in Chrome as well by using the SHIFT key instead of CTRL.

为了解决这个问题,您可以在用户单击要选择的单元格后立即清除选择:

$(".subject").live('click',function(event) {
    if(event.ctrlKey) {
          $(this).toggleClass('selected');  
    } else {
          $(".subject").removeClass("selected");
          $(this).addClass("selected");           
    }
    if (document.selection)
        document.selection.empty();
    else if (window.getSelection)
        window.getSelection().removeAllRanges();
});

更新了小提琴 http://jsfiddle.net/5CxPr/52/.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Firefox 上奇怪的蓝色边框 的相关文章