-
Notifications
You must be signed in to change notification settings - Fork 864
Conversation
@a-v-l - First, thanks so much for taking the time to submit a pull request. This is a cool idea. Unfortunately, I don't think I'm going to merge it into the project, because it adds extra lines of code for functionality that will only be used by people with fixed headers (which won't be everyone). I'd rather see folks who have this need add the offset into the script themselves. |
@cferdinandi No problem – you are the lead developer :-) But I think your script will be much more versatile with this option. It was after I send the pull request when I found that I am not the only one with this usecase (#3). If you are concerned about the extra lines, we could use a ternary operator to squeeze the code in two extra lines:
Running this code in googles closure compiler will result in 70 extra Bytes (1.425 vs 1.495) which I think is an acceptable amount. And this would save us "fixed header guys" to have to "hack" the core, enabling us to add your repository to the "third party" folder and not worry about updating… Anyway – thank you for this cool script in the first place! |
@a-v-l - You've convinced me! One minor request: can we use |
Really happy to contribute! See commit: No problem with using BTW: Do you want me to "clean up" before merging? |
If you wouldn't mind, that would be much appreciated. And I'll be sure to give you appropriate credit. Thanks again Arndt! |
Websites using a fixed navigation bar can add the class "scroll-header" to the navigation element to offset the end of the scrolling animation at the right position - and not as default at the top of the page.
Here you go! Have a nice day over at Boston… |
Add offset support for fixed headers
Awesome, thanks Arndt! |
Websites using a fixed navigation bar can add the class "fixed-header" to the navigation element to offset the end of the scrolling animation at the right position - and not as default at the top of the page.