私は多くの関連する質問を見つけましたがiframe
、iOS4で2本の指の方法を使用してスクロールする方法を説明する答えはありません。
aと属性を設定し、をdiv
設定することで、2本の指でaをスクロールできます。これのより完全な例は次のとおりです。width
height
overflow: scroll;
<div style='width: 280px; height: 200px; overflow: scroll; -webkit-overflow-scrolling: touch;'>
Just imagine a bunch of content is in here, spanning well over 200px
worth of height. You can scroll this just fine in iOS 4 by using 2
fingers, or in iOS 5 by swiping 1 finger thanks to
"-webkit-overflow-scrolling: touch;".
</div>
これと同じ方法はiframes
、iOS4.3を実行しているiPad1では機能しません。これは、iOS 4で指の組み合わせでスクロールしない完全な例です(もちろん、-webkit-overflow-scrolling
iOS5で動作することを許可します):
<html>
<head>
<style type="text/css">
#scroller {
width: 280px;
height: 200px;
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
#scroller iframe {
width: 100%;
height: 100%;
}
</style>
</head>
<body>
<div id="scroller">
<iframe src="content.html">content.html is a big list of nonsense.</iframe>
</div>
</body>
</html>
およびをのように実際のピクセル値に設定すると、2本の指でスクロールできることを付け加えなければなりませんが、iframeのコンテンツの高さはわかりません。それで、おそらく本当の問題は、iOS 4のモバイルSafariに、この内部が実際に280x200ピクセルよりも大きいことをどのように納得させることができるかということです。width
height
iframe
height: 1000px;
iframe
div