-
Notifications
You must be signed in to change notification settings - Fork 824
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
Adding methods to freeze / unfreeze the current headroom's state. #309
Conversation
Why closing it? |
Must have done it on accident, sorry! |
No prob, thanks for your answer. |
This looks good to me, thanks @andreivictor. I'll get this merged now and try and work out a plan for release. I'll also need to update the docs. Unless you have a desire to do that also? |
I will try to update the |
Don't do it on the weekend if you don't want to, enjoy yourself instead! There's also a website on the gh-pages branch, but it's been so long since I've had to update that, I'm not sure what state it is in. |
Just updating the readme would be more than enough. |
Updated in #316. Thanks! |
Published to npm as |
Inspired from another PR (#253), I've added methods to freeze and unfreeze the current headroom's state.
freeze
method: When called, this method will freeze the current headroom's state (pinned or unpinned). Headroom will not react to the user's scroll. If you wish to re-enable the headroom's default behaviour, you can call unfreeze method.unfreeze
method: When called, this method will resume headroom's default behaviour. Headroom will pin or unpin when the user scrolls the page. By default, Headroom is not freezed and calling this method before freeze will do nothing.There is also a new property -
frozen
- for the classes option:Usage:
Example:
https://codepen.io/andreivictor/pen/oymbLO