gpt4 book ai didi

css - 如何删除选定行的悬停效果?

转载 作者:太空宇宙 更新时间:2023-11-03 20:24:45 25 4
gpt4 key购买 nike

我将 .k-state-selected 更改为不同的颜色,效果很好。但是,当我将鼠标悬停在所选行上时,悬停颜色为蓝色。我试过了

.k-grid tr:hover{
背景:透明;
}

这对未选择的行有效,但对选定的行无效。本质上我需要删除选定行上的悬停效果但无法弄清楚

$("#grid").kendoGrid({
columns: [{
field: "name"
},
{
field: "age"
}
],
dataSource: [{
name: "Jane Doe",
age: 30
},
{
name: "John Doe",
age: 33
}
],
selectable: "row"
});
.k-grid .k-state-selected {
background: #ec971f;
}
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.common.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.rtl.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.silver.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.mobile.all.min.css" />

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2019.3.1023/js/kendo.all.min.js"></script>

<div id="grid"></div>

最佳答案

试一试:

$("#grid").kendoGrid({
columns: [{
field: "name"
},
{
field: "age"
}
],
dataSource: [{
name: "Jane Doe",
age: 30
},
{
name: "John Doe",
age: 33
}
],
selectable: "row"
});
.k-grid .k-state-selected {
background: #ec971f;
}

.k-grid .k-state-selected:hover {
background: #ec971f!important;
color:#000;
}
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.common.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.rtl.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.silver.min.css" />
<link rel="stylesheet" href="https://kendo.cdn.telerik.com/2019.3.1023/styles/kendo.mobile.all.min.css" />

<script src="https://code.jquery.com/jquery-1.12.4.min.js"></script>
<script src="https://kendo.cdn.telerik.com/2019.3.1023/js/kendo.all.min.js"></script>

<div id="grid"></div>

关于css - 如何删除选定行的悬停效果?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59309353/

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