Results 1 to 2 of 2
Like Tree1Likes
  • 1 Post By ShiftyAxel
  1.    #1  
    Hi I have an app that is basically a html page.

    I have a problem though as the html page is longer than the viewable screen and the page wont scroll.

    Ive added this div

    <div id="scrollerId" style="width:320px; height:100px" x-mojo-element="Scroller">
    <div >scrolling content</div>
    </div>

    but it doesnt do anything


    Please can someone help explain how to add one. or if i need to add anything to my javascript file or anything else ?

    source/helloworld.jsjsjs

    enyo.kind({
    name: "HelloWorld",
    kind: enyo.VFlexBox,
    components: [
    {kind: "PageHeader", components: [
    {content: "Page Header"}
    ]},
    {flex: 1, kind: "Pane", components: [
    {flex: 1, kind: "Scroller", components: [
    //Insert your components here
    ]}
    ]},
    {kind: "Toolbar", components: [
    ]}
    ]
    });


    Im a newbie to webos dev so go easy on me

    Cheers Andrew
  2. #2  
    Well for starters you're trying to put a Mojo scroller around an Enyo app. If you're developing in Enyo, your index.html should be really simple, something like this (without the bold bits, obv.):

    HTML Code
    <!doctype html>
    <html>
    <head>
    <title>App Name</title>
    <meta name='viewport' content='height=device-height'>
    (Gets the device height so the app'll fit properly on Pre3)

    <script src="../enyo/1.0/framework/enyo.jsjsjs&$quot$; $type$=&$quot$;$text$/$javascript$&$quot$;&$gt$;&$lt$;/$script$&$gt$;
    (This should point to the enyo framework, either on your computer for testing in chrome/safari or /usr/palm/frameworks/enyo/1.0/framework/enyo.jsjsjs $for$ $devices$)
    </head>
    <body>

    <script type="text/javascript">
    new HelloWorld().renderInto(document.body);
    (This is the part that actually renders your app, EVERYTHING else should be done in helloworld.jsjsjs)
    </script>

    </body>
    </html>


    Your scrolling content should go in the Scroller kind in helloworld.jsjsjs

    I suggest you have a read through the Enyo Developer Pages. They're not as good as they could be, but I managed to learn Enyo in a week and create my first App and JSJSJS $Service$ $with$ $them$ ($WiFi$ $File$ $Sharing$, $in$ $my$ $sig$.). $Another$ $good$ $place$ $to$ $look$ $is$ $the$ Enyo API Reference. It has documentation on all the kinds available to you in Enyo. Happy Development!
    webOS Ports' UI Architect & luna-sysmgr guru.
    OldSkoolVWLover likes this.

Tags for this Thread

Posting Permissions