www.webOShelp.net

Get the latest on:webOS Developers' RSS FeedwebOS Facebook page webOS Twitter Feed

Home

Scroller

Example usage:

In the scene's view file:

<div x-mojo-element="Scroller" id="featureScroller" class="featureScroller">
  <div id="featureStoryDiv">
    <div id="featureStoryTitle" class="featureTitle">#{title}</div>
    <div id="featureStory" class="featureSummary">#{text}</div>
  </div>
</div>

Everything inside the scroller div becomes the scrollable content.  

The widget is instantiated in the scene assistant:

this.controller.setupWidget('featureScroller', this.featureScrollerModel);

Care must be taken to set up the proper CSS for the scroller, setting its height explicitly (or width, if it's a horizontal scroller) so that it the scroller div does not automatically expand to fit its contents and consequently not scroll at all.

.featureScroller {
    height: 100px;
    margin-bottom: 10px;
}

Here's how this example might look (with additional supporting code):

mojo scroller