MRT
MRT

Reputation: 1610

How do I stop window scrollable in phoneGap (iphone)?

I am using phoneGap and jQuery Mobile. When I use a <div></div> tag then it works properly but on an iPhone it is auto scroll-able. How do I stop this?

Upvotes: 2

Views: 670

Answers (1)

Rafael Marques
Rafael Marques

Reputation: 825

if you want to prevent a div to scroll use this:

<div id="container" ontouchmove="touchMove(event);"> content goes here </div>

and the function touchMove(event):

touchMove = function(event) { event.preventDefault(); }

hope this works

Upvotes: 3

Related Questions