离子型:同时使用离子anchorScroll不能向上滚动 [英] Ionic: Can't scroll up while using anchorScroll in ionic

查看:268
本文介绍了离子型:同时使用离子anchorScroll不能向上滚动的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在使用离子应用scrollTo功能通过设置 $的location.hash(ID) $ anchorScroll()。滚动到下工作正常,但是一旦页面滚动使用 $ anchorScroll 一些位置和 $位置,我们不能向上滚动页面。哈希()

We are using scrollTo functionality in ionic application by setting the $location.hash(id) and $anchorScroll(). The scroll to bottom is working fine, but we can't scroll up the page once the page scrolled to some location using $anchorScroll and $location.hash().

请参阅问题显然 codePEN 。点击应用于底部的按钮,并尝试了回滚。

See the issue clearly in codepen. Click on To Bottom button and try to scroll up back.

请提供一个解决方案来解决这个问题,滚动

Please provide a solution to fix this scroll issue.

推荐答案

在离子含量分区添加溢出滚动=真正的

On "ion-content" div add overflow-scroll="true"

<ion-content overflow-scroll="true">

然后在您的控制器:

then in your controller:

$scope.scrollTo = function(id) {
    $location.hash(id);
    $ionicScrollDelegate.anchorScroll();
};

此问题在离子框架的进一步信息可以在这里找到:
http://forum.ionicframework.com/t/content-stuck-after -anchorscroll / 776

这篇关于离子型:同时使用离子anchorScroll不能向上滚动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆