Here is the CSS code I am working with:
.footer {
font-family: "lato", sans-serif;
padding: 20px;
line-height: 1.2;
text-align: right;
background: #eee;
color: #0D47A1;
font-size: 13px;
height: 80px;
position: fixed;
right: 0px;
bottom: 0px;
left: 0px;
z-index: 10;
transition: all 500ms;
}
.footer.scrolled {
transform: height(100px);
}
I am trying to achieve the functionality where the footer on an HTML page disappears when a user scrolls down. I attempted to implement this using JavaScript by adding the following script to my HTML page:
function hideFooter() {
if(window.pageYOffset > 10) {
.footer.addStyleName("scrolled");
} else {
.footer.removeStyleName("scrolled");
}
}
Additionally, I included the following in my HTML body tag:
<body onload="onload()" onscroll="hideFooter()">
Although the function triggers properly when scrolling, it does not apply the desired style changes to the footer. I am currently unable to determine the reason why.