rbowen / centos / centos.org

Forked from centos/centos.org 5 years ago
Clone

Blame assets/js/script.min.js

401d07
window.addEventListener("DOMContentLoaded",()=>{const e=new IntersectionObserver(e=>{e.forEach(e=>{const t=e.target.getAttribute("id");e.intersectionRatio>0?document.querySelector(`nav li a[href="#${t}"]`).parentElement.classList.add("active"):document.querySelector(`nav li a[href="#${t}"]`).parentElement.classList.remove("active")})});document.querySelectorAll("h2[id]").forEach(t=>{e.observe(t)})});