Is there a way to ‘fix’ the browser viewport in place in iOS (iPhone and iPad) to prevent the background movement on swipe? The screen will fit the 1024×768 landscape/portrait dimenions so doesnt need to scroll at all..
I need to build a training site that replies on swipe actions to trigger functions – but the moving screen makes this effect look awful!
You can try to capture and prevent the
ontouchmoveevent for the whole document.HTML:
JS:
Instead of binding to the native JS, you easily re-write this to jQuery using .on():
(jQuery code is not tested).
I have to say this approach isn’t rock-solid the last time I checked, because “sometimes” the scrolling does take place.
You can also take a look at ScrollFix to create fullscreen web apps.