I have developed a responsive website that allows users to bookmark it on their home screen. It would be ideal for the site to prevent the screen from displaying any grey background when scrolling to the top or bottom on tablets and phones, rather than snapping back abruptly.
I understand that using 'preventDefault' on the body can achieve this, but at present, it unfortunately disables scrolling altogether.
Below is the snippet of javascript code:
$(document).ready(function(){
document.ontouchmove = function(e){e.preventDefault();}
});
And here is how the html call looks like:
<body ontouchmove="touchMove(event)">