bilden
continuous-integration/drone/push Build is passing
Details
continuous-integration/drone/push Build is passing
Details
This commit is contained in:
parent
887f53a09a
commit
8277de849c
|
@ -21,17 +21,27 @@ title: Start
|
|||
</script>
|
||||
|
||||
<script>
|
||||
window.addEventListener('scroll', () => {
|
||||
const header = document.querySelector('.md-header');
|
||||
const tabs = document.querySelector('.md-tabs');
|
||||
if (window.scrollY > window.innerHeight * 0.8) {
|
||||
header.style.transform = "translateY(0)";
|
||||
if (tabs) tabs.style.transform = "translateY(0)";
|
||||
function toggleMenuVisibility() {
|
||||
const content = document.getElementById("main-content");
|
||||
const header = document.querySelector(".md-header");
|
||||
const sidebar = document.querySelector(".md-sidebar");
|
||||
const contentTop = content.getBoundingClientRect().top;
|
||||
|
||||
if (contentTop <= 0) {
|
||||
header.style.opacity = "1";
|
||||
sidebar.style.opacity = "1";
|
||||
header.style.pointerEvents = "auto";
|
||||
sidebar.style.pointerEvents = "auto";
|
||||
} else {
|
||||
header.style.transform = "translateY(-100%)";
|
||||
if (tabs) tabs.style.transform = "translateY(-100%)";
|
||||
header.style.opacity = "0";
|
||||
sidebar.style.opacity = "0";
|
||||
header.style.pointerEvents = "none";
|
||||
sidebar.style.pointerEvents = "none";
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
window.addEventListener("scroll", toggleMenuVisibility);
|
||||
window.addEventListener("load", toggleMenuVisibility);
|
||||
</script>
|
||||
|
||||
<!-- Bakgrundsbild med filter -->
|
||||
|
|
Loading…
Reference in New Issue