Files
rappaurio-sae501_502/app/node_modules/wikiapi/docs/scripts/nav.js
2023-09-25 09:41:55 +02:00

13 lines
368 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();