Hello!
I am looking to disable Rubberband page Scrolling on mobile.
However, I want to make sure scrolling is enabled for all of the elements in the page.
This code (that I got from another related Hype Forum post) works great to prevent all scrolling:
var preventScroll = function (event) {
event.stopPropagation();
event.preventDefault();
}
var docElement = hypeDocument.getElementById(hypeDocument.documentId());
if(docElement.addEventListener) {
docElement.addEventListener('touchmove', preventScroll, true);
}
But since it prevents all scrolling, this code won’t work for me.
Awesome, so cool to hear that iNoBounce can work with Hype!
Just to clarify:
I am confused when you say Inner HTML - I would have thought that I’d need to add this to the Head HTML in order to affect the entire page.
Do I need to add this to the Inner HTML of some page element(s)?
Just want to make sure I know where to put the code.
The code above doesn’t work for me on iOS 10.3.2 on an iPad, at least not using Hype Reflect. Perhaps there was a change in iOS 10.3.2 that brakes this?
I found that putting this in the HTML header works:
<script type="text/javascript">
document.addEventListener('touchmove', function (event) {
event.preventDefault();
}, false);
</script>