Skip to content

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

@brandonpeat

Description

@brandonpeat

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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions