Javascript 水平和垂直滚动时,离子无限滚动不起作用
我正在开发一款ionic应用程序,它有一个页面有水平滚动。我想使用离子无限滚动的垂直和水平滚动,但它只是工作的水平滚动现在 有人能告诉我,如果我能在同一页中同时拥有水平滚动和垂直滚动的无限滚动吗Javascript 水平和垂直滚动时,离子无限滚动不起作用,javascript,angularjs,ionic-framework,scroll,Javascript,Angularjs,Ionic Framework,Scroll,我正在开发一款ionic应用程序,它有一个页面有水平滚动。我想使用离子无限滚动的垂直和水平滚动,但它只是工作的水平滚动现在 有人能告诉我,如果我能在同一页中同时拥有水平滚动和垂直滚动的无限滚动吗 <div> <ion-scroll direction="x" class="con-scroll-x" has-bouncing="true"> <div class="scroll-div">
<div>
<ion-scroll direction="x" class="con-scroll-x" has-bouncing="true">
<div class="scroll-div">
<div class="scroll-div-item" ng-repeat="trips in globalPlaces.result_trip_search">
<img alt="title" src="img/list-img/1.jpg" />
<div class="scroll-item-caption">
<div class="caption-rect">
<img alt="title" src="img/ic_hiker.png" />
<span>{{ trips.count_ratio }}</span>
</div>
<div class="scroll-caption-text">
<p>Viaje a:</p>
<h3 class="title-break">{{ trips.end_city }}</h3>
</div>
<div class="scroll-caption-date">
<span>{{ trips.start_date }}</span> <img alt="title" src="img/ic_date.png" /> <span>{{ trips.end_date }}</span>
</div>
<div class="comm-user-img">
<!-- scroll-cap-user-pics -->
<!--<img scroll-cap-user-pics alt="title" src="img/list_user1.png" />-->
<img alt="title" src="{{ trips.profile_photo }}" class="comm-global-user-img" />
</div>
</div>
</div>
</div>
</ion-scroll>
</div>
{{trips.count_ratio}
维亚杰a:
{{trips.end_city}
{{trips.start_date}{{trips.end_date}}
当我垂直滚动时,上面的代码在无限滚动中产生了一些问题。它在水平方向上运行良好。实际上是在爱奥尼亚
中,就像在同一页面中有离子滚动
和离子无限滚动
时,爱奥尼亚无法发射无限负载
可能的解决方案
将您的ion滚动条
包装在DIV
内,并将ng if
添加到该DIV
中,并在控制器中将ng if
模型设置为true
示例
HTML
<div ng-if="PleaseShowMe">
<ion-scroll direction="x" class="con-scroll-x" has-bouncing="true">
<---other code--->
</ion-scroll>
</div>
注意:即使这样,您也无法实现水平滚动,但您可以在垂直滚动时将数据附加到水平滚动。@jalajsharma:欢迎使用,很高兴它对您有效。但也请阅读注释部分。
$timeout(function()
{
$scope.PleaseShowMe = true;
},50);