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
Problems when switching height of sticky header #23
Comments
Sorry, but I don't understand the issue or can't see it in the example. I see the increased height non-sticky header, and the shorter sticky state, but scrolling up and down at various window heights I don't see anything out of the ordinary. It may help if you phrase it in the following format.
|
Hi Caleb, Thanks for looking at this. I will try to be clearer. Action taken: Then try to scroll. Expected results: Actual results: many thanks |
Crazy question, but is your page zoomed by chance? If you hit Ctrl/Cmd+0 (zero) does this still occur? I can't reproduce this in Windows or OSX Lion in either of the browsers you mentioned, except when text is in a zoomed out state. |
No question is crazy when it comes to browser quirks :) Zoom is reset and issue is still occurring both to me and a colleague who are both on Windows 7. I can email you a screenshot as i can't see an option to add one in the github comments cheers |
Screen cast http://goo.gl/BJaOM |
Interesting, thanks for the video. I'll try reproducing on a Win 7 box tomorrow and get back to you on this. |
In the meantime, could try making |
Thanks for the help. I will try this |
Thanks Caleb, this has partially solved the issue and may well suit my purposes. However, i can see some circumstances where you will not want #main-nav-holder to have a fixed height. When the states switch , to the sticky header, the following content is in the same position it was before the switch, leaving excess blank space between the sticky header and this content until you scroll down further. |
So I finally understand the exact situation that will cause this. Your example is too tall for my 13" MBP running at 1280x800. So that I do not forget, here is the scenario:
First, and this may sound weird, I'm glad this is happening. A change in scrollOffset through the waypoint's offset value really should trigger the waypoint, and it's position shouldn't automatically be recalculated. Those recalculations only happen automatically on window resizes and when waypoints are added. Second, there's something to handle this type of scenario already, thank goodness. The refresh function. From that documentation (emphasis added):
Making the call after you change classes within the callback should force the recalculation before the next scroll check and things should be good. Give it a try and let me know how it works. |
@neilpowers Any update on using the method above? |
Hi Caleb, I have been using the fixed height wrapper solution for the time being. I tried the refresh option but it didn't appear to work in my quick test. On a future iteration on the project i will further investigate the refresh approach. Thank you very much for your help with this. cheers Neil |
Hi,
Thanks for a great plugin!
I have implemented a sticky header based on the demo that is provided with one change which is causing problems in certain scenarios.
My change is that the header has a large height set in css before the .sticky class is attached.
Once .sticky class is attached a .sticky specific rule changes the height of the header.
This works fine in most scenarios. However, when the height of the page is only just scrollable the page jumps back to full height header element and wont display the minimized .sticky height of the header. The problem is not present when the page has a lot of content.
I have made the ammends to a local version of the sticky demo just to make sure it was not anything in my implementation.
Here is the demo i made to show the problem http://postnatalcounselling.com/original-waypoints-sticky-demo/ .
Any help you can suggest would be great. many thanks Neil
The text was updated successfully, but these errors were encountered: