[英]Disable moving in an iPhone web application but leave scrolling?
要禁用本機tochemove事件通常需要使用:
document.body.addEventListener('touchmove', function(e){ e.preventDefault(); });
但是如果想要阻止移動窗口(屏幕邊框)但是保留滾動頁面內容的功能呢?
使用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.