Closed dakur closed 4 years ago
Hmm... I'm surprised this ever worked. It is intended that you specify both up
and down
values when passing an object for tolerance
. If you do that, everything should work:
import Headroom from 'headroom.js';
const menuElement = document.getElementById('menuBar');
const headroom = new Headroom(menuElement, {
tolerance: {
up: 50,
down: 0,
},
});
headroom.init();
See a working example here: https://codepen.io/WickyNilliams/pen/zYOLbqK?editors=0010
I should really add some TS typings to the library to help with stuff like this.
I was expecting that modifying only one of those options will leave the second one to default. Thank you for clarification. TS typings would definitely prevent this. :-)
It worked in 0.9.4, but no more – neither in 0.10.4 nor in 0.11.0. Do I miss something?
Code:
No custom class selectors, ran on
DOMContentLoaded
,--not-top
etc. are added as they should be.