html {
height: 100%;
width: 100%;
overflow: hidden;
}
body{
margin: 0;
min-width: 980px;
padding: 0;
height: 100%;
width: 100%;
overflow: auto;
}
In order to prevent macOS rubber band scrolling and detect the scroll direction, the following CSS and JavaScript are being used:
var iScrollPos = 0;
$(window).scroll(function () {
var iCurScrollPos = $(this).scrollTop();
if (iCurScrollPos > iScrollPos) {
console.log('down');
} else {
console.log('up');
}
iScrollPos = iCurScrollPos;
});
However, the element $(window)
is not relevant due to the CSS styles applied.