I am working on a Bootstrap use case. I have designed a menu using Bootstrap. I want the menu to be hidden when I scroll down, and the menu to be displayed if I scroll up. (slide-down / slide-up).
I want to use jQuery for this functionality.
window.onscroll = function() {
scrollFunction()
};
function scrollFunction() {
if (document.body.scrollTop > 150 || document.documentElement.scrollTop > 150) {
$('.center-menu').slideUp();
$(bottomDiv).fadeIn();
} else {
$('.center-menu').slideDown();
$(bottomDiv).fadeOut();
}
}