leafo/sticky-kit

Messed up positioning in 1.1.4

Opened this issue · 2 comments

I use this script on various sites and had trouble with phantom scrolling in chrome on all pages. I used the fix from #218 and updated to unofficial 1.1.4 but now the positioning gets messed up. I have a sticky navbar with a offset and a sticky sidebar below, but the navbar gets stuck too late and as a result the sidebar now partially disappears behind the navbar instead of sticking below. If I set recalc_every to 1, all works but the performance is bad, especially on mobile devices. Any higher value of recalc_every has a chance to not correctly position my navbar so that it disappears behind the header on the first scrollwheel move.
I assume this happens because the tick() function now doesn't update documents height itself but gets a static value. I tried for hours to solve this but had no luck yet. Anyone able to help?

short update: as soon as I set recalc_every, phantom scrolling is back...

@cdhannes
recalc_every: 10
It worked for me.