简体   繁体   English

禁用在iPhone Web应用程序中移动但保留滚动?

[英]Disable moving in an iPhone web application but leave scrolling?

To disable native tochemove event usually one want to use: 要禁用本机tochemove事件通常需要使用:

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? 但是如果想要阻止移动窗口(屏幕边框)但是保留滚动页面内容的功能呢?

With UIWebView following code might help you- 使用UIWebView以下代码可能会帮助您 -

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM