-
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
Custom functions to determine whether or not to pin/unpin headroom element #96
Comments
👍 but maybe call them |
Those names work for me. I am not the best at coming up with function names xD |
this has previously been discussed. the idea was to have the same thing but cancel the action if the regular onPin/onUnpin callbacks returned false. thoughts? this would negate the need for yet more callbacks/options |
I think this would solve my problem of having the mobile menu disappear when the page is scrolled on a mobile device. |
@WickyNilliams This comment is a little late, but that would work for me. |
In a modified version of this that I changed, I added the ability to pass in two new options: shouldPinCheck and shouldUnpinCheck (couldn't think of better names). These are functions that must return true/false. They are fired inside the shouldPin/shouldUnpin functions in the return statement.
Therefore, if a headroom goes to unpin and the shouldUnpinCheck returns false, the headroom element shouldn't be unpinned. Same thing for the shouldPinCheck but opposite.
If it was useful to me, I thought it may be useful to someone else as well. Maybe this should be added into the codebase.
The text was updated successfully, but these errors were encountered: