Compare commits
2 Commits
a491d8bedc
...
ade412c92d
| Author | SHA1 | Date | |
|---|---|---|---|
| ade412c92d | |||
|
|
478d4f3201 |
@@ -615,8 +615,10 @@ function tabs(containerId, items, onPick){
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* ---------- navigation ---------- */
|
/* ---------- navigation ---------- */
|
||||||
const navLinks = document.querySelectorAll("nav.side a");
|
/* menu items only: the sidebar footer also holds a regular external link */
|
||||||
|
const navLinks = document.querySelectorAll('nav.side a[href^="#"]');
|
||||||
function show(id){
|
function show(id){
|
||||||
|
if(!document.getElementById(id)) return;
|
||||||
document.querySelectorAll("main section").forEach(s => s.classList.toggle("on", s.id === id));
|
document.querySelectorAll("main section").forEach(s => s.classList.toggle("on", s.id === id));
|
||||||
navLinks.forEach(a => a.classList.toggle("active", a.getAttribute("href") === "#" + id));
|
navLinks.forEach(a => a.classList.toggle("active", a.getAttribute("href") === "#" + id));
|
||||||
el("main").scrollTop = 0;
|
el("main").scrollTop = 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user