gpt4 book ai didi

javascript - Firefox 上奇怪的蓝色边框

转载 作者:数据小太阳 更新时间:2023-10-29 04:25:19 26 4
gpt4 key购买 nike

请看一下这段代码

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

在 Firefox 上,当您按 ctrl 按钮选择多行时,它会显示奇怪的蓝色边框,但在 Chrome 上则不会。

enter image description here

使用最新的 Firefox 10.0.2。

是浏览器相关的错误吗?

最佳答案

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

通过使用 SHIFT 键而不是 CTRL,您也可以在 Chrome 中观察到同样的问题。

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

$(".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();
});

Updated fiddle .

关于javascript - Firefox 上奇怪的蓝色边框,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9451841/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com