简体   繁体   English

两列离子无限滚动

[英]Ionic Infinite scroll with two columns

I'm having an issue with Ionic (1.3.1) and ion-infinite-scroll. 我在离子(1.3.1)和离子无限滚动方面遇到问题。 I have two columns, one at the right with a variable height and another at the left with the infinite scroll, but both items should scroll at the same time. 我有两列,一列在右侧,高度可变,而另一列在左侧,无限滚动,但是两个项目应同时滚动。 The problem I have, is when the right column is too large, in that case I have to scroll down to the bottom of the page to have more items at the left. 我遇到的问题是,当右列太大时,在这种情况下,我必须向下滚动到页面底部才能在左边有更多项。

<div class="row" >

    <div class="col col-50">
        <ion-list>
            <ion-item ng-repeat="item in items" item="item" href="#/item/{{item.id}}">
                Item {{ item.id }}
            </ion-item>
        </ion-list>
        <ion-infinite-scroll ng-if="!noMoreItemsAvailable" on-infinite="loadMore()" distance="10%" style="height:100%;"></ion-infinite-scroll>
     </div>

     <div class="col col-50">
         Very large column with variable height
     </div>
 </div>

I created a codepen showing the issue: 我创建了一个显示问题的代码笔:

http://codepen.io/charlieme/pen/ybPBbQ http://codepen.io/charlieme/pen/ybPBbQ

My expected result is to scroll both items at the same time, but always having items at the left, without having to scroll to the bottom of the page. 我的预期结果是同时滚动两个项目,但始终在左侧有项目,而不必滚动到页面底部。

Thanks in advance. 提前致谢。

解决此问题的方法是在右列中放置用于项目的惰性加载组件,因为我将元素隐藏在视口下方,所以页面的底部始终位于屏幕上,允许用户使用无限滚动而无需滚动右列中的所有项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM