-
Notifications
You must be signed in to change notification settings - Fork 64
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
Sidebar in the middle of page on pageload #16
Comments
StickyNavbar script remembers the position of window that was before refresh. |
@jbutko Thank you very much, just sent you an email. |
I am having the same problem, and its still unclear how to fix it. Its live on the following (dutch) website: http://www.examentrainingexact.nl/examentraining/1-vwo-wiskunde-a |
@kaibakker: Hi, try to reference version 1.1.3 of stickyNavbar in the script tag instead of 1.1.1 http://cdn.jsdelivr.net/stickynavbar.js/1.1.3/jquery.stickyNavbar.min.js |
Thanks @jbutko for looking at it. But its still not working? I tried some different things and changed the version number, but still the bar is hanging on reload, any other ideas? |
@kaibakker: Hi, really not sure why this happened on your site, it looks like it is working fine on my demo page. Anyway you can probably fix it with this workaround (I do not tested it properly but it should work IMO): var leftColVertPosition = $('.l-left').offset().top,
windowVerticalPos = $(window).scrollTop(),
menuBar = $('#menubar');
if (windowVerticalPos > leftColVertPosition) {
menuBar.style.top = "0";
} Try it, adapt it if needed and let me know. |
Thank you! Works perfectly, eventual used this script... $(document).ready(function () {
$('#menubar').stickyNavbar();
var leftColVertPosition = $('.l-left').offset().top,
windowVerticalPos = $(window).scrollTop(),
menuBar = $('#menubar');
if (windowVerticalPos > leftColVertPosition) {
menuBar.css({top: "0"});
}
}); |
No problem Kai, glad I could help. |
If my page is scrolled down and I refresh the page, the navbar is something just randomly in the middle of the page.
Here you can see the signup button, etc in the middle of the page.
The text was updated successfully, but these errors were encountered: