Closed appventor closed 4 years ago
This is a good question and you are on the right track. Halfmoon uses a page wrapper for the different sections and a content wrapper for the content. What you are actually scrolling is the content wrapper. So the following is a possible fix:
<div class="page-wrapper">
<div class="content-wrapper" onscroll="scrollFunction()">
...
</div>
</div>
Please note that since you mentioned hiding the navbar on scroll, the easiest way to do this is by removing the .with-navbar
class from the page wrapper. Something like this:
function scrollFunction() {
halfmoon.pageWrapper.classList.remove("with-navbar");
}
That will automatically hide the navbar and reposition your sidebar and content.
Ok thank you for the quick response. Its working as expected now.
Hello, I wanted to shrink the navbar on scroll by using js function
window.onscroll = function () { console.log("onscroll"); scrollFunction(); //handling navbar height according to scroll value from top using document.body.scrollTop() };
but it never gets triggered. is it because of page-wrapper? i dont get any error. Can you help me with this?