gpt4 book ai didi

jquery - 如何在 treeview(jquery) 中突出显示选定的节点?

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

.treeview ul {
background-color: white;
margin-top: 4px;
}
.treeview a:visited {
background-color: Yellow;
}
.treeview a:active {
background-color: Yellow;
}

.treeview a:selected {
background-color: Yellow;
}

当我单击该节点时,由于回发,事件 CSS 不起作用。我如何突出显示单击的事件节点并且 css 不应该因回发而受到影响?

最佳答案

ASPX 页面的服务器控件上试试这个

<asp:TreeView id="LinksTreeView"
Font-Names= "Arial"
ForeColor="Blue"
SelectedNodeStyle-ForeColor="Green"
SelectedNodeStyle-VerticalPadding="0"
OnSelectedNodeChanged="Select_Change"
runat="server">

引用:http://msdn.microsoft.com/it-it/library/system.web.ui.webcontrols.treeview.aspx

jQuery

$(".treeview a").click(function(){ 
$(this).css("backgroundColor", "blue");
});

关于jquery - 如何在 treeview(jquery) 中突出显示选定的节点?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18930255/

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