Wire up scroll to top button
This commit is contained in:
parent
43bbb7fbcd
commit
294d5bd656
3 changed files with 5 additions and 2 deletions
|
@ -6,4 +6,8 @@ window.addEventListener("load", () => {
|
||||||
navbarBurger.classList.toggle("is-active");
|
navbarBurger.classList.toggle("is-active");
|
||||||
navbar.classList.toggle("is-active");
|
navbar.classList.toggle("is-active");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
document.getElementById("scroll-top").addEventListener("click", () => {
|
||||||
|
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
html,
|
html,
|
||||||
body {
|
body {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow-y: auto;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="button is-radiusless">Top</button>
|
<button class="button is-radiusless" id="scroll-top">Top <i class="fas fa-angle-up ml-2" aria-hidden="true"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in a new issue