$(document).scroll(function () {
var y = $(this).scrollTop();
var screen_height = window.innerHeight;
var scroll_height = document.body.scrollHeight;
var when_show_menu = scroll_height - screen_height;
if (y > when_show_menu ) {
$('#navigator').fadeOut();
} else {
$('#navigator').fadeIn();
}
});
$(document).scroll(function () {
var y = $(this).scrollTop();
if (y > 2000) {
$('#navigator').fadeOut();
} else {
$('#navigator').fadeIn();
}
});
O_ovar screen_height = window.innerHeight; var scroll_height = document.body.scrollHeight;
var screen_height = $(window).height();
var scroll_height = $(document).height();
Find more questions by tags CSSjQueryJavaScriptHTML
$(document).scroll(function () {
var y = $(this).scrollTop();
if (y > 2000) {
$('#navigator').fadeOut();
} else {
$('#navigator').fadeIn();
}
}); - jaycee commented on July 8th 19 at 11:37
I repeat: Your code works as it should (both the first and the second). - Gisselle.Sporer commented on July 8th 19 at 11:40