2010-06-05 61 views
0

無法水平滾動滾動。我錯過了什麼?無法使水平滾動工作

這裏是我的第一scene.html代碼:

<div id="main" class="palm-hasheader"> 
    <div class="palm-header">Header</div> 
     <div id="scrollerId" style="width:500px; height:500px" x-mojo-element="Scroller"> 
     <div> 
     My Text that goes on... and on... and on... horizontally... 
     </div> 
    </div>  
</div> 

這裏是我的代碼在第一assistant.js:

function FirstAssistant() { 
    /* this is the creator function for your scene assistant object. */ 
} 

FirstAssistant.prototype.setup = function() { 
    /* this function is for setup tasks that have to happen when the scene is created */ 

     this.controller.setupWidget("scrollerId", 
     this.attributes = { 
     mode: 'horizontal' 
      } 
    ); 

}; 

FirstAssistant.prototype.activate = function(event) { 
    /* put in event handlers here that should only be in effect when this scene is active. */ 
}; 

FirstAssistant.prototype.deactivate = function(event) { 
    /* remove any event handlers you added in activate and do any other cleanup */ 
}; 

FirstAssistant.prototype.cleanup = function(event) { 
    /* this function should do any cleanup needed before the scene is destroyed as 
     a result of being popped off the scene stack */ 
}; 
+0

有沒有任何這個在線演示,所以我們可以檢查它? – Gavrisimo 2010-06-06 01:23:06

回答

1

我想通了。 scrollderId是包含設置寬度和高度的div。包含div內的div有一個新的寬度設置大於包含div回滾和爲:

<div id="scrollerId" style="width:320px; height:100px" x-mojo-element="Scroller"> 
    <div style="width:500px"> 
       Complication's my claim to fame 
       And I can't believe there's another 
       Constantly just another 
       I can't avoid what I can't control 
       And I'm losing ground 
       Still I can't stand down 
       And I know, yeah I know, yeah 
       Complication's my claim to fame 
       And I can't believe there's another 
       Constantly just another 
       I can't avoid what I can't control 
       And I'm losing ground 
       Still I can't stand down 
       And I know, yeah I know, yeah 
       Complication's my claim to fame 
       And I can't believe there's another 
       Constantly just another 
       I can't avoid what I can't control 
       And I'm losing ground 
       Still I can't stand down 
       And I know, yeah I know, yeah 
    </div> 
</div> 
0

對HTML snipet只需快速瀏覽告訴我,你是不要關閉你的div。試試這個html:

<div id="main" class="palm-hasheader"> 
    <div class="palm-header">Header</div> 
     <div id="scrollerId" style="width:500px; height:500px" x-mojo-element="Scroller"> 
      <div> 
      My Text that goes on... and on... and on... horizontally... 
      </div> 
     </div> 
    </div> 
</div> 

就像我說的,我沒有更深入的問題,然後那些前幾行。 :)

+0

其實它已關閉。 div class =「palm-header」有一個關閉div。它在'Header'之後。 – kylex 2010-06-06 01:15:40

+0

Oooops .... :)對不起,只是想回答一個問題,然後去睡覺,但似乎我太累了回答... <_ < – Gavrisimo 2010-06-06 01:22:04