leafo / sticky-kit

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

In Safari, doc.height() is always 1 pixel more than last_scroll_height #216

Open jsit opened 7 years ago

jsit commented 7 years ago

No idea why this is happening, but it results in the .is_stuck class being removed and re-added on every little scroll event. I changed line 119 (within the tick() function) to read:

if (!recalced && Math.abs(doc.height() - last_scroll_height) > 1) {

And it works.

Safari 10.0.2.

carasmo commented 7 years ago

Thank you!

TrilipuT commented 7 years ago

yeah, very strange bug... But actually safari also very strange browser )