leafo/sticky-kit

Suggestion: change "scroll < top" to "scroll <= top" on line 140

Opened this issue · 1 comments

Apologies, I'm a Github newbie, this is probably the wrong forum in which to offer suggestions?

In "jquery.sticky-kit.js" I suggest changing line 140 from if (scroll < top) { to if (scroll <= top) {.

If like me you're using Sticky-Kit to stick a header at the very top of your screen and change its CSS on scrolling (like #header{background:#fff} #header.is_stuck{background:#000} or some such), the "is_stuck" class applies on scroll but is never removed when you scroll back to the top. It's on that header permanently until you reload. The above tweak solved my issue.

I'm not a jquery expert so maybe there's a reason for the existing method I've overlooked? Thanks!

Aha, looks like somebody beat me to it:
#117