mirror of
https://github.com/tchartron/blow
synced 2024-11-23 21:03:16 +00:00
update
This commit is contained in:
parent
970412e902
commit
4ea8249ada
2 changed files with 2 additions and 2 deletions
|
@ -164,7 +164,7 @@ document.addEventListener("DOMContentLoaded", function() {
|
|||
// })
|
||||
});
|
||||
function setActiveToc(elements) {
|
||||
elements.reverse();
|
||||
// elements.reverse();
|
||||
return [...elements].find((item) => {
|
||||
return (item.getBoundingRect().y < 0)
|
||||
})
|
||||
|
|
|
@ -1 +1 @@
|
|||
function setActiveToc(e){return e.reverse(),[...e].find(e=>e.getBoundingRect().y<0)}document.addEventListener("DOMContentLoaded",function(){document.getElementById("navbar").clientHeight,document.getElementById("toc");const e=document.querySelectorAll("#toc li a");document.getElementById("page-content");let t=!1,n=[];[...e].forEach(e=>{n.push(e.href.substring(e.href.indexOf("#")))});const o=document.querySelectorAll(n.join(","));console.log(o),window.addEventListener("scroll",()=>{!1===t?(e[0].classList.add("bg-blue-800"),t=e[0]):console.log(setActiveToc(o))})});
|
||||
function setActiveToc(e){return[...e].find(e=>e.getBoundingRect().y<0)}document.addEventListener("DOMContentLoaded",function(){document.getElementById("navbar").clientHeight,document.getElementById("toc");const e=document.querySelectorAll("#toc li a");document.getElementById("page-content");let t=!1,n=[];[...e].forEach(e=>{n.push(e.href.substring(e.href.indexOf("#")))});const o=document.querySelectorAll(n.join(","));console.log(o),window.addEventListener("scroll",()=>{!1===t?(e[0].classList.add("bg-blue-800"),t=e[0]):console.log(setActiveToc(o))})});
|
Loading…
Reference in a new issue