:)ます。私は、オリエンテーションが変更されたときにコンテンツがもはやスクロールする必要がないDIVに影響を与えるという事実に絞り込んだ。
あなたの例では、右のDIVは横向きにスクロールし、縦向きにスクロールする必要はありませんが、再度スクロールする必要があります。私は両方のDIV(左右)が向きに関係なくスクロールする必要があり、問題ではない場合にこれをテストしました。
更新日:
実際これを修正したようです。
問題はタイミングの問題であるようです。サイズ変更の際、内側のコンテンツは、オーバーフローした外側のDIVのスクロールを保証するのに十分な大きさではありません。この日を無駄にした後、私は最終的に、このハックを思い付いた:ページのサイズが変更するたびに
<div id="header" style="position:fixed; height:100px">Header</div>
<div id="content" style="overflow: auto; -webkit-overflow-scrolling: touch">
<div id="contentInner">
content that is not long enough to always scroll during different orientations
</div>
</div>
はここに私のロジックです:
function handleResize()
{
var iHeight = $(window).height() - $("#header").height();
// Height needs to be set, to allow for scrolling -
//this is the fixed container that will scroll
$('#content').height(iHeight - 10);
// Temporarily blow out the inner content, to FORCE ipad to scroll during resizing
// This is a timing issue where the inner content is not big enough during resize post orientation to require the outer DIV to scroll
$('#contentInner').height(1000);
// Set the heights back to something normal
// We have to "pause" long enough for the re-orientation resize to finish
window.setTimeout(delayFix, 10);
}
function delayFix()
{
var iHeight = $(window).height() - $("#header").height();
// Inner divs force the outer div to always have at least something to scroll. This makes the inner DIV always "rubber-band" and prevents
// the page from scrolling all over the place for no reason.
// The height of the inner guy needs to be AT LEAST as big as the container and actually a nip bigger to cause the
// scrollable area to 'rubber band' properly
$('#contentInner').height(iHeight + 20);
}
私はこの質問を完全に忘れてしまいました。私は実際にあなたと同じ解決策でそれを理解してしまいました。私はコードをここにバックアップしておいて、時間を節約して、おっと!しかし、ありがとう:) – will
誰かが興味を持っている場合、別の方法が見つかりました...任意のコメント歓迎。下記参照。 –
それは本当に素晴らしい作品です。あまりにも悪いことが最初にそこにある必要があります。 –