I am working on a jquery mobile app. I'm detecting scroll event to do something when someone starts scrolling. Its working fine in desktop browsers and android browsers but in ios the scroll event works after the scroll stops rather than working at the start of scrolling.
Here's my code -
$("#main").on('scroll', function(){
$("#bottom-fixed-contents").fadeOut("fast");
clearTimeout( $.data( this, "scrollCheck" ) );
$.data( this, "scrollCheck", setTimeout(function() {
$("#bottom-fixed-contents").fadeIn("slow");
}, 500) );
});
CSS
#main {
width: 100%;
height: 100%;
overflow-y: scroll;
font-family: 'Helvetica';
-webkit-overflow-scrolling: touch;
}
#bottom-fixed-contents {
position: fixed;
}