WHITECOLOR
WHITECOLOR

Reputation: 26142

Disable moving in an iPhone web application but leave scrolling?

To disable native tochemove event usually one want to use:

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

But what if want to prevent moving the window (ot of the borders of the screen) but leave the capabilities for scrolling the content of the page?

Upvotes: 3

Views: 455

Answers (1)

rishi
rishi

Reputation: 11839

With UIWebView following code might help you-

 UIWebView *webView = ...
//set zoom
UIScrollView *scrollView = [webView.subviews objectAtIndex:0];
[scrollView setZoomScale:0.0 animated:YES];

Upvotes: 1

Related Questions