@yuna0x0/anilist-node
Version:
A lightweight Node.js wrapper for the AniList API
16 lines (14 loc) • 346 B
JavaScript
function scrollToNavItem() {
var path = window.location.href
.split("/")
.pop()
.replace(/\.html/, "");
document.querySelectorAll("nav a").forEach(function (link) {
var href = link.attributes.href.value.replace(/\.html/, "");
if (path === href) {
link.scrollIntoView({ block: "center" });
return;
}
});
}
scrollToNavItem();