Trent Stewart
Trent Stewart

Reputation: 881

Stop page from scrolling on android browser

I have been attempting to stop my web page from scrolling, this works easy enough on desktop browsers with overflow: hidden; but this will not work on my android tab, it just seems to keep scrolling no matter what i do. I have played around with preventDefault on scroll but this doesn't seem to work at all.

Cheers

Upvotes: 0

Views: 257

Answers (1)

Wes Cossick
Wes Cossick

Reputation: 2933

This should work:

document.ontouchmove = function(event){
    event.preventDefault();
}

Upvotes: 1

Related Questions