Closed DanielRuf closed 4 years ago
@DanielRuf In that case I would recommend using position:fixed
in your CSS.
@DanielRuf In that case I would recommend using position:fixed in your CSS.
Right, this is the approach that we chose in the end. But it would be good to also make this dynamic with the script to have a better control based on other things on the website.
I guess there a >=
somewhere which prevents this usecase.
Sometimes you have an element like a header which should be directly sticky on documentready/load based on other things (like the viewport).
Currently it does not work when the element sits directly at the top (scrollTop 0). It never adds the classes or fires the sticky method.