Skip to content

Commit d14a32a

Browse files
committed
Color tab links on hover
1 parent 25be782 commit d14a32a

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

style.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,16 @@ h2 > a:not(:last-child) {
109109
margin-right: 0.3em;
110110
}
111111

112+
h2 > a {
113+
color: gray;
114+
}
115+
h2 > a:hover {
116+
color: dimgray;
117+
}
118+
h2 > a.activetab {
119+
color: black;
120+
}
121+
112122
ul {
113123
list-style-position: inside;
114124
list-style-type: square;

valg.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,13 @@ function update() {
798798

799799
function showTab(tab) {
800800
for (var i = 0; i < tabs.length; i++) {
801-
tabs[i].style["display"] = tab == i ? "block" : "none";
802-
links[i].style["color"] = tab == i ? "black" : "gray";
801+
if (tab == i) {
802+
tabs[i].style["display"] = "block";
803+
links[i].className = "activetab";
804+
} else {
805+
tabs[i].style["display"] = "none";
806+
links[i].removeAttribute("class");
807+
}
803808
}
804809
};
805810

0 commit comments

Comments
 (0)