views:

136

answers:

2

Can't get it to scroll horizontally. What am I missing?

Here's my code in first-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>

Here's my code in first-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 */
};
A: 

Just quick look on that html snipet tells me that you are not closing on of your div's. Try this 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>

Like i said, i didnt go any deeper into the problem then those first few lines. :)

GaVrA
Actually it was closed. The div class="palm-header" has a closing div. It's after the word 'Header'.
kylex
Oooops.... :) Sorry about that, just thought to answer one more question and then go to bed, but it seems im too tired to answer... <_<
GaVrA
+1  A: 

I figured it out. The scrollderId is the containing div with a set width and height. The div inside the containing div has a new width set larger than the containing div to scroll back and for with:

<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>  
kylex