Skip to content

Custom functions to determine whether or not to pin/unpin headroom element #96

@jeffshaver

Description

@jeffshaver

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.

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