2015-09-23 143 views
3

我有一個窗口,它有垂直滾動,在這個滾動中我有幾個圖像列表有水平滾動。垂直滾動不能在離子水平滾動列表上工作

<ion-content class="container"> 
    <ion-scroll direction="y" class="wide-as-needed"> 
     <div> 
      <ion-scroll direction="x" class="wide-as-needed"> 
       <imgcard ng-repeat="item in items" card="item"></imgcard> 
      </ion-scroll> 
     </div> 
     <div> 
      <ion-scroll direction="x" class="wide-as-needed"> 
       <imgcard ng-repeat="item in items" card="item"></imgcard> 
      </ion-scroll> 
     </div> 
     <div> 
      <ion-scroll direction="x" class="wide-as-needed"> 
       <imgcard ng-repeat="item in items" card="item"></imgcard> 
      </ion-scroll> 
     </div> 
     <div> 
      <ion-scroll direction="x" class="wide-as-needed"> 
       <imgcard ng-repeat="item in items" card="item"></imgcard> 
      </ion-scroll> 
     </div> 
     <div> 
      <ion-scroll direction="x" class="wide-as-needed"> 
       <imgcard ng-repeat="item in items" card="item"></imgcard> 
      </ion-scroll> 
     </div> 
     <div> 
      <ion-scroll direction="x" class="wide-as-needed"> 
       <imgcard ng-repeat="item in items" card="item"></imgcard> 
      </ion-scroll> 
     </div> 

</ion-content> 

這裏<imgcard>指令歸結爲:

<div class="card"> 
    <div class="card-image"> 
     <img src="{{card.image}}"/> 
    </div> 
    <div class="card-description"> 
     {{card.desc}} 
    </div> 
</div> 

現在的問題是,當移動我嘗試,如果我接觸的空間之間的圖像列表,它工作正常垂直滾動。但是,如果我在垂直滾動時觸摸圖像列表,它不起作用。

回答

1

我認爲這是一個離子蟲。 在離子束線8392它設置變量isScrolling

if (typeof isScrolling == 'undefined') { 
isScrolling = !!(isScrolling || Math.abs(delta.x) < Math.abs(delta.y)); 
} 

但是當我調試我的應用程序,delta.x == 0和delta.y == 0的大部分時間如此isScrolling ==假也。 只需在比較中加上a =即可。