I really like the headroom.js but I just can not get it working. Some kind of step-by-step instruction would be great. So here is what I did so far...
I downloaded the git repro
Included the scripts to my html file right before my closing body tag
<script type="text/javascript" src="js/headroom/Headroom.js"></script>
<script type="text/javascript" src="js/headroom/jQuery.headroom.js"></script>
Added following css to my css files
.headroom { position: fixed; top: 0; left: 0; right: 0; transition: all .2s ease-in-out; } .headroom--unpinned {top: -100px;} .headroom--pinned {top: 0;}
Added the headroom script at the very and even after the scripts links in point number 2
<script> (function() { var header = new Headroom(document.querySelector("#header"), { tolerance: 5, offset : 205, classes: { initial: "animated", pinned: "slideDown", unpinned: "slideUp" } }); header.init(); }()); </script>
Added the necessary ids and classes to my header HTML element
<header id="header" class="header header--fixed hide-from-print" role="banner"><my navigation stuff goes in there></header>
But I do not get it working somehow. I do not see any classes applied when scrolling nor anything else. Does anyone know the wrong part?
I would be so greatful,..
thanks in advance