What I’m trying to accomplish is shown here: https://imgur.com/a/YFcfO3N
Basically I want a menu that sits at the bottom of the page and when you scroll up it sticks to the bottom of the page.
What I’m trying to accomplish is shown here: https://imgur.com/a/YFcfO3N
Basically I want a menu that sits at the bottom of the page and when you scroll up it sticks to the bottom of the page.
2
Answers
To keep the menu at the bottom of the page and stick to it when scrolling up, you can set the menu position to
position: fixed;
here is the example code
I just took a look in the developer console at https://imgur.com/a/YFcfO3N and it seems, they use a container for the footer with the class "Footer-wrapper" with the following CSS attributes:
When scrolling down, there is another class added to the container, "down":
The negative position must correspond to the height of the footer / menu.
I think, they’re doing this with JavaScript. You can check whether the user is at the top of the page in JavaScript like this:
The class can be added to the element like this:
and removed like this:
I hope this helps