I have a function that fades out some element when user comes to the end of a web page, no i need a function that will fade out an element when reaching some html block with a specific class('.s-footer').
function hideMenu() {
var mainMenu = $('.main-head');
if ($(document).scrollTop() == $(document).height() - $(window).height()) {
mainMenu.fadeOut();
}
else {
mainMenu.fadeIn();
}
}
$(window).scroll(hideMenu);