Skip to content
This repository was archived by the owner on Apr 28, 2020. It is now read-only.

Add offsettTop to offsetHeight for scrollHeader #36

Merged
merged 1 commit into from
Feb 19, 2014

Conversation

follesoe
Copy link
Contributor

If you have multiple fixed headers, it’s not enough to calculate the headerHeight as the height of the sticky header element. We need to add the offsetTop to compensate for the first sticky header.

If this is a general behavior that should be included in the smooth-scroll lib I'm not sure - sending this PR as a suggestion to a scenario you might have to consider. That beeing said, it shouldn't be a problem, as the offsetTop will be 0 for users/sites with a singly sticky header.

If you have multiple fixed headers, it’s not enough to calculate the
headerHeight as the height of the sticky header element. We need to add
the offsetTop to compensate for the first sticky header.
cferdinandi pushed a commit that referenced this pull request Feb 19, 2014
Add `offsettTop` to `offsetHeigh`t for `scrollHeader`. Allows for multiple fixed headers, or a fixed header that sits slightly below the top of the page.
@cferdinandi cferdinandi merged commit a1d5921 into cferdinandi:master Feb 19, 2014
@cferdinandi
Copy link
Owner

Nice add. Thanks!

@follesoe
Copy link
Contributor Author

Sweet, glad to be of help. Can now switch our bower config to point back to this repo instead of my own branch.

@Cam
Copy link

Cam commented Mar 10, 2014

The offset header doesn't seem to work for me. It just stops the scroller working at all. What's the correct usage for this?

@cferdinandi
Copy link
Owner

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants