leafo / sticky-kit

A jQuery plugin for creating smart sticky elements
http://leafo.net/sticky-kit
2.9k stars 517 forks source link

Messed up positioning in 1.1.4 #229

Open cdhannes opened 7 years ago

cdhannes commented 7 years ago

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?

cdhannes commented 7 years ago

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

dimondevs commented 7 years ago

@cdhannes recalc_every: 10 It worked for me.