facebook

Dynamic HTML height

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #336269 Reply

    Brandon
    Member

    I am working on a better rss feed and it is working great except for the html widget height. Since I dont know how much info the feed has I dont know how large to make it. Is there a way to have the html widget and the scroll panel dynamically update to the content?

    #336414

    Brandon
    Member

    Anything?

    #336526

    Hi CincyPlanet,

    Maybe Yann’s solution can be helpful for you.

    #336555

    Yann
    Member

    Hello CincyPlanet
    now i don’t use panel1 widget
    i put directly an HTML widget and i put my div code inside

    <div id="wrapper">
        <div id="scroller">
    <ul id="maliste"></ul></div>
    </div>
    

    you populate your div wiht js function and call scroller.refresh
    run as well for me

    function populatersp(data)
    {
    el = document.getElementById('maliste');
        
            while(el.hasChildNodes()){
                el.removeChild(el.childNodes[0])
                
                }
    
    var myScroll = new iScroll('wrapper',
    {          snap: true,
              momentum: true,
              hScrollbar: false,
              vScrollbar: false,
              bounce: true,
            });
    
    $('#maliste').append(data);    
    myScroll.refresh();
    }
    #336557

    Brandon
    Member

    Yann,

    Thanks I will try this, the other code didn’t work out well.

    #336559

    Brandon
    Member

    It kind of works, but the second I stop scrolling down it snaps back up to the top.

    #336563

    Yann
    Member

    Hi
    i not sure to understand ,
    have you try to change iscroll properties ?

    Yann

    #336566

    Brandon
    Member

    Yeah. I tried various settings and even tried different places for the function call. I can upload the screen here if you want to check it out. Its just the Google RSS feed for the MobiOne Cheatsheet app. It works really good except for loading the dynamic content when it is long.

    #336583

    Yann
    Member

    Hello CincyPlanet
    I had the same problem, this is the reason why I adapted this script
    http://davidwalsh.name/demo/iscroll/examples/pull-to-refresh/
    i load and create 20 <li> on loading and load “step” by “step” when you scrolling down 5 <li> by 5 <li>
    Yann

    #336607

    Brandon
    Member

    Yann,

    Thanks I will look into that when I get a chance.

Viewing 10 posts - 1 through 10 (of 10 total)
Reply To: Dynamic HTML height

You must be logged in to post in the forum log in