PublishingJS:TheNewSocial: Difference between revisions
No edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
document.onreadystatechange = function () { | document.onreadystatechange = function () { | ||
const nav_links = document.querySelectorAll(' | const nav_links = document.querySelectorAll('#toc a'); | ||
console.log(nav_links) | console.log(nav_links) |
Revision as of 14:24, 19 April 2023
console.log( 'Hello from PublishingJS namespace!' )
document.onreadystatechange = function () {
const nav_links = document.querySelectorAll('#toc a');
console.log(nav_links)
window.onhashchange = function() {
for (let i = 0; i < nav_links.length; i++) {
if (nav_links[i].href.match(/(#.*)/)[1] == window.location.hash) {
nav_links[i].className = 'selected';
} else {
nav_links[i].className = '';
}
}
};
}