WickyNilliams / headroom.js

Give your pages some headroom. Hide your header until you need it
https://wicky.nillia.ms/headroom.js/
MIT License
10.86k stars 824 forks source link

Header is not pinned, only shows up when scrolled to top #363

Closed hrvstr closed 4 years ago

hrvstr commented 4 years ago

Hi, how can I get the header to show up when "pinned" like in the example page?

I added this library to my project but the header only displays when I scroll to the top. I can see that classes are being applied and the transition is animated.

Here is a fiddle: http://jsfiddle.net/dbeg2n6q/2/

Notice the header fades in and out but it does not appear "pinned" when scrolling up in the middle of the page.

hrvstr commented 4 years ago

Found the problem, the header class needed the following css values:

 position: fixed;
 top: 0;