Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS Web app disable offset scrolling

How can I disable the offset scrolling for my webapp?

I mean the dark gray area http://i.stack.imgur.com/a3Rt4.png

Disable scrolling in an iPhone web application? I've tried this but it didn't work all the time, it only works sometimes then it suddenly stops and i can scroll again.

like image 291
antpaw Avatar asked Jul 06 '11 14:07

antpaw


1 Answers

document.body.addEventListener('touchmove', function(e){ e.preventDefault(); });

works, but make sure the body has a 100% height of the screen

like image 199
antpaw Avatar answered Oct 29 '22 18:10

antpaw