angularjs - ionic : Can't scroll up while using anchorScroll in ionic

标签 angularjs ionic-framework

我们通过设置 $location.hash(id) 在 ionic 应用程序中使用 scrollTo 功能和 $anchorScroll() .滚动到底部工作正常,但是一旦页面使用 $anchorScroll 滚动到某个位置,我们就无法向上滚动页面。和 $location.hash() .

codepen中看清楚问题.单击到底部按钮并尝试向上滚动。

请提供解决此滚动问题的解决方案。

最佳答案

在“ ionic 内容”div 上添加溢出滚动=“真”

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

然后在您的 Controller 中:
$scope.scrollTo = function(id) {
    $location.hash(id);
    $ionicScrollDelegate.anchorScroll();
};

可以在此处找到有关 Ionic Framework 中此问题的更多信息:
http://forum.ionicframework.com/t/content-stuck-after-anchorscroll/776

关于angularjs - ionic : Can't scroll up while using anchorScroll in ionic,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28564189/

相关文章:

javascript - 如何正确调用我的工厂服务?

AngularJS 指令链接函数未被调用

css - Ionic 3 ionic 单选按钮使用 flex 彼此靠近显示选项

AngularJS:无法获取指令中隔离范围属性的访问值

WordPress + angularJS 路由 + SEO

javascript - AngularJs 路由和刷新

linux - 如何在后台运行ionic

angular - 如何使用 ion-col 响应式设置大型动态表数据

android - 在 Ionic 2/Cordova 中设置 Android 版本代码

editor - 如何为 Notepad++ 添加角度支持?