[英]How to solve the issue of position:fixed for a button at the bottom of the screen in iOS (ipad/iphone)?
[英]HTML 5 fixed screen iPad
我似乎找不到正確的標簽。 當在某些地方在iPad上滑動屏幕時,整個屏幕都會移動,借助“橡皮筋”效果,我知道有一種鎖定屏幕的方法,特定於HTML5和Webkit。
使用<iframe src="" width="1024" height="724" scrolling="no"></iframe>
看起來像是便宜的修補程序,這些是我的標頭。
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1.0, maximum-scale=1.0"/> <meta name="apple-mobile-web-app-capable" content="yes" /> <meta name="apple-mobile-web-app-status-bar-style" content="black" />
嘗試這個:
<script>
// document.body works probably too
document.ontouchmove = function(e) {
e.preventDefault();
};
</script>
請注意,此方法將禁用整個頁面的滾動! 有時這可能是不可取的。 如果是這樣,請查看如何在iOS Web Apps中禁用橡皮筋?
以防萬一人們不閱讀答案的評論,這是我在調查@bebraw的評論時發現的解決方案:
這么小的東西需要很多工作,但是可以采用細粒度的方法來了解滾動的內容和不滾動的內容。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.