0
.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 不应因回发而受到影响?

4

1 回答 1

1

在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");
});
于 2013-09-21T07:53:24.770 回答