Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
brandonpeat opened this issue May 24, 2017 · 1 comment
Open

Comments

@brandonpeat
Copy link

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!

@brandonpeat
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant