dollarshaveclub / stickybits

Stickybits is a lightweight alternative to `position: sticky` polyfills 🍬
https://github.com/yowainwright/stickybits
MIT License
2.19k stars 167 forks source link

Initial position stuck? #589

Open pburkindine opened 4 years ago

pburkindine commented 4 years ago

I am trying to figure out how to have a bottom-sticky element start stuck. Currently if I create a bottom sticky it will not initially be visible until the DOM is scrolled (I am getting around this by quietly scrolling the DOM 2 pixels on page init; not sure why 2px works but 1 doesn't).

Is there a setting or a method I can invoke?

pburkindine commented 4 years ago

The trick of scrolling the window does not work in IE11, by the way; I have not found a workaround that does.

Related and in IE11 only - if I have a sticky element stuck to the top of the screen and perform an action which removes it and shows another sticky element, the new sticky element does not immediately appear until I scroll.