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

Using separate up/down offset values introduced a bug with the top and notTop classes behaviour #377

Open
luksak opened this issue Jun 30, 2021 · 0 comments

Comments

@luksak
Copy link

luksak commented Jun 30, 2021

Using separate up/down offset values breaks removal of the notTop class and the addition of the top class.

To reproduce this issue set different top and bottom offsets. Scrolling down and back up leaves the headroom--not-top and doesn't add the headroom--top class on the element.

Here is the code I am using:

const options = {
  offset: {
    up: 150,
    down: 40,
  },
  useTouchmove: true,
}
headroomInstance = new Headroom(document.body, options);
headroomInstance.init();

I can reproduce this behavior in Firefox and Chrome.

xch1029 added a commit to xch1029/headroom.js that referenced this issue Jul 5, 2021
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