2010-06-05 11 views
0

Impossible de faire défiler horizontalement. Qu'est-ce que je rate?Impossible de faire défiler horizontalement pour travailler

Voici mon code dans la première 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> 

Voici mon code au premier 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

Y a-t-il une démo en ligne pour que nous puissions le vérifier? – Gavrisimo

Répondre

1

Je l'ai compris. Le scrollderId est le div contenant une largeur et une hauteur définies. La div à l'intérieur du div contenant a une nouvelle largeur plus grande que la div contenant pour faire défiler et avec:

<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

Il suffit de regarder rapidement sur ce snipet html me dit que vous êtes ne pas fermer de votre div. Essayez cette 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> 

Comme je l'ai dit, je na pas aller plus loin dans le problème, les premières lignes. :)

+0

En fait, il était fermé. Le div class = "palm-header" a une div de fermeture. C'est après le mot "Header". – kylex

+0

Oooops .... :) Désolé à ce sujet, juste pensé pour répondre à une autre question et puis aller au lit, mais il semble que je suis trop fatigué pour répondre ... <_ < – Gavrisimo

Questions connexes