我在使用Phonegap/Cordova構建的JQTouch iPhone應用程序中使用iScroll 4(cubiq.org/iscroll-4)。iScroll將不會水平滾動,直到放大
我的問題是,水平滾動,雖然'hScroll:true',直到我放大和縮小我的圖像,這使得一切工作正常(確認iScroll的作品和CSS的包裝/滾動是正確的)。
HTML:
<div id="wrapper">
<div id="scroller"></div> // Also tried with img-tag in div instead of as bg
</div>
CSS:
#wrapper {
position:absolute;
top:45px; bottom:0; left:0; // 45px is header
z-index:1;
width:100%; // Also tried with window size (320)
overflow:auto; // Also tried with scroll
}
#scroller {
position:absolute; z-index:1;
width: 1024px; // The size of my image
height: 414px; // The height of my image
background: url(img/test.png) no-repeat;
padding: 0;
}
JAVASCRIPT:
var myScroll;
function loaded() {
myScroll = new iScroll('wrapper', {
hScrollbar: true,
vScrollbar: true,
hScroll: true,
vScroll: true,
zoom: true
});
}
更改 'VSCROLL' 和 '縮放' 的參數具有預期的效果的時候了。與水平滾動相關的參數在縮放啓動後纔會執行任何操作。
我嘗試刷新包裝或滾動到加載後的座標,編輯我的應用程序的加載順序,但沒有任何幫助。
感謝您的時間, 安德烈亞斯。
你有沒有解決這個問題?我會着迷於知道答案,因爲我有類似的問題。 – RecursivelyIronic 2012-12-14 03:26:37