简体   繁体   English

当您向上滚动以显示内容时,如何防止离子幻灯片向下“反弹”?

[英]How to prevent ion-slide from 'bouncing' back down when you are scrolling up to reveal content?

http://codepen.io/leongaban/pen/yeBjWx http://codepen.io/leongaban/pen/yeBjWx

在此处输入图片说明

Note above, try to scroll the list to reveal the content at the bottom. 注意,请尝试滚动列表以显示底部的内容。 Once you let go of the mouse the list scrolls or rather "rubber-bands" back down, hiding the content once again. 一旦放开鼠标,列表就会向下滚动,或者更确切地说是“橡皮筋”,再次隐藏内容。

Markup 标记

<ion-content>
  <div class="social-stream-container">
    <ion-scroll direction="y" id="social-tweets">
      <ion-list>
        <ion-item class="social-content-block" ng-repeat="t in tweets | filter: orderBy">
          {{t}}
        </ion-item>
      </ion-list>
    </ion-scroll>
  </div>
</ion-content>

Styling (the content box has a certain height, so user needs to be able to scroll to see more) 样式(内容框具有一定的高度,因此用户需要能够滚动才能看到更多内容)

.social-stream-container {
  overflow: hidden;
  height: 187px;
  background: cyan;
}

I tried adding this to the ion-scroll : has-bouncing="false" but that stopped any kind of scrolling at all. 我尝试将其添加到ion-scrollhas-bouncing="false"但这根本停止了任何形式的滚动。

Here is the fix: http://codepen.io/leongaban/pen/yeBWWB 解决方法如下: http : //codepen.io/leongaban/pen/yeBWWB

The div with class of social-stream-container was removed and that class was then placed on the ion-scroll element. 删除了具有social-stream-container类的div,然后将该类放置在ion-scroll元素上。

<ion-slide id="twitter">
    <h1>TWEETS</h1>
    <ion-scroll class="social-stream-container" direction="y" id="social-tweets">
      <ion-list>
        <ion-item class="social-content-block" ng-repeat="t in tweets | filter: orderBy">
          {{t}}
        </ion-item>
      </ion-list>
    </ion-scroll>
</ion-slide>

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

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