I would like to toggle menu at the bottom during scroll event. So I've created a fixed menu which show/hides based on its position from the top. The event currently only fires during touch. Is there any way to get event triggered when the web page is scrolling after finger is lifted off from the device? Scroll event works well on android device.
function toggleMenu() {
if ($('.menu').offset().top < $('.fixed-menu').offset().top + 32) {
$('.fixed-menu').css('visibility', 'hidden');
} else {
$('.fixed-menu').css('visibility', 'visible');
}
}
$(window).on("load resize scroll touchstart touchmove touchend", function (e) {
toggleMenu();
});
html, body {
height: 100%;
-webkit-overflow-scrolling: touch;
overflow-y: scroll;
}