我剛開始爲iPad開發一些類似web應用程序的網站。我使用YUI的scrollView列表,這很好地工作。Yahoo yui和iPad方向
現在的問題是,當方向發生變化時,我必須更新滾動條實例的高度,但我不知道如何完成。
據我所知,應該有一些聽衆和事件參數或我的雜亂的代碼片段。有任何想法嗎?
YUI().use("scrollview", function (Y) {
if(window.orientation == 0) // Temp solution to set the right height on load.
{ var iheight = 740; }
else if(window.orientation == 90 || window.orientation == -90)
{ var iheight = 480; }
var scrollview = new Y.ScrollView({
id: "scrollview",
srcNode: '#scrollable',
height: iheight,
flick: {
minDistance:10,
minVelocity:0.3,
axis: "y"}
});
scrollview.render();
scrollView._uiDimensionsChange(); // Think I'm supposed to use this somehow.
});
你讀過[this thread](http://yuilibrary.com/forum/viewtopic.ph P + P = 22599)? – 2011-03-31 13:47:40
是的,但是當我看到它時,他們正在談論全屏佈局和身體課程。礦井更像是一個具有特定寬度/高度的裝箱清單,取決於設備的方向。 – Xavio 2011-03-31 14:13:27