【发布时间】:2015-01-26 17:48:46
【问题描述】:
我正在使用一个 Ionic 应用程序,它有一个侧面菜单,我在其中放置了一些按钮作为大型 html 内容的索引。当我单击侧面菜单按钮 element.scrollIntoView(false) 时,将 ion-scroll 容器滚动到元素。
我发现的问题是我可以向下滚动并继续阅读 html,但我无法向上滚动。
离子滚动定义:
<ion-scroll delegate-handle="contentScroll" zooming="true" min-zoom="1.0" height="100%" style="height:100%" direction="['x','y']">
<div id="page-container" style="padding: 45px 5px 5px 5px;text-align: justify;">
</div>
</ion-scroll>
一个按钮定义:
<ion-content ng-controller="ScrollCtrl as scroll">
<button class="button" ng-click="scroll.to('markElementN')" menu-close style="width:100%">ElementN</button>
</ion-content>
scroll.to 函数是:
function(mark) {
if (mark == undefined || typeof mark != 'string' || mark.length < 1) {
return;
}
var ob = document.getElementById(mark);
if (ob) {
ob.scrollIntoView(false);
}
}
¿有同样问题的人吗?
我应该补充一点,我可以再次向下和向上滚动,但不能高于我滚动到视图中的元素
【问题讨论】:
标签: ionic