-
Notifications
You must be signed in to change notification settings - Fork 782
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
Post page navigation disappears when scrolling down #378
Comments
I found the following code in the And there is a question:
$(window).on("scroll", function() {
var topDistance = menu.offset().top;
// hide only the navigation links on desktop
console.log(topDistance)
if (!nav.is(":visible") && topDistance < 50) {
nav.show();
} else if (nav.is(":visible") && topDistance > 100) {
nav.hide();
}
// on tablet, hide the navigation icon as well and show a "scroll to top
// icon" instead
if ( ! $( "#menu-icon" ).is(":visible") && topDistance < 50 ) {
$("#menu-icon-tablet").show();
$("#top-icon-tablet").hide();
} else if (! $( "#menu-icon" ).is(":visible") && topDistance > 100) {
$("#menu-icon-tablet").hide();
$("#top-icon-tablet").show();
}
}); |
I try to change if (!nav.is(":visible") && topDistance < 50) {
nav.show();
} else if (nav.is(":visible") && topDistance > 100) {
nav.hide();
} if (!nav.is(":visible") && topDistance <= 100) {
nav.show();
} else if (nav.is(":visible") && topDistance > 100) {
nav.hide();
} |
Same problem, looking for a solution. I wonder if this issue be introduced recently or it just sit there for a long time? |
I use the var topDistance = document.documentElement.scrollTop;// menu.offset().top;
// hide only the navigation links on desktop
const distanceLimit = 50;
if (!nav.is(":visible") && topDistance < distanceLimit) {
nav.show();
} else if (nav.is(":visible") && topDistance >= distanceLimit) {
nav.hide();
} |
It has been a long time. It looks like the author will not update the project. |
My priorities have indeed shifted to other projects. People have suggested fixes for this issue but none of them really resolved it. If you have something that works across all major web browsers, feel free to create a PR and I'll look into it. |
Did a quick test and found that all the proposed fixes work on my machine with Firefox 125.0.2 and Chromium 124.0.6367.91:
I saw people saying that for some of these fixes, high resolution or a post full of images may still trigger the issue; but I failed to reproduce (used dev tools to emulate resolution 4096x2160). |
Post-page navigation disappears when scrolling down. And it does not reappear after back to top.
Is there a way to solve this?
The text was updated successfully, but these errors were encountered: