watusi / jquery-mobile-iscrollview

JQuery Mobile widget plug-in for easy use of the iScroll javascript scroller.
407 stars 183 forks source link

When using in JQM, 1st child of the listview is styled as it should not when data-iscroll is inside data-role=content #75

Open cardinal27513 opened 11 years ago

cardinal27513 commented 11 years ago

I can repro this using 'shortpull_11.html' demo. It's not a big deal but I spent quite some time to figure that out in my app and hope this help other to avoid that.

It works fine as shown in here...

      <div data-iscroll="" data-role="content"> <!-- This is fine -->

        <div class="iscroll-pulldown">
          <span class="iscroll-pull-icon"></span><span class="iscroll-pull-label"></span>
        </div>

        <ul data-role="listview"><li>Item 1 blanditiis ipsam aut inventore</li><li>Item 2 vel explicabo cumque consequatur</li><li>Item 3 quisquam quidem distinctio repudiandae</li></ul>

        <div class="iscroll-pullup">
          <span class="iscroll-pull-icon"></span><span class="iscroll-pull-label" data-iscroll-loading-text="Custom loading text" data-iscroll-pulled-text="Custom pulled text">Custom reset text</span>
        </div>

        </div>

This is not fine if I wrap data-iscroll inside "content". The 1st child in the listview is styled out side of my control for some reason.

      <data-role="content"> <!-- This is NOT FINE-->
      <div data-iscroll="" > <!-- This is NO FINE-->

        <div class="iscroll-pulldown">
          <span class="iscroll-pull-icon"></span><span class="iscroll-pull-label"></span>
        </div>

        <ul data-role="listview"><li>Item 1 blanditiis ipsam aut inventore</li><li>Item 2 vel explicabo cumque consequatur</li><li>Item 3 quisquam quidem distinctio repudiandae</li></ul>

        <div class="iscroll-pullup">
          <span class="iscroll-pull-icon"></span><span class="iscroll-pull-label" data-iscroll-loading-text="Custom loading text" data-iscroll-pulled-text="Custom pulled text">Custom reset text</span>
        </div>
        </div>        
        </div>