【发布时间】:2017-07-19 02:11:09
【问题描述】:
我对 Angular $anchorScroll 有疑问,请参阅 offical doc's、gotoBottom 示例。单击goToBottm 后,$anchorScroll 将添加到该位置的url ID - mysite.com/tag/##ID,在第一次加载时它工作正常,但是当refershing 页面ID 停留在url 的结尾,并且滚动不起作用。
有想法该怎么解决这个吗?我的代码:
HTML:
<button ng-click = "addRow(); gotoBottom()">add row </button>
还有身份证:
<table id = "bottom">
...
</table>
gotoBottom 在我的controller:
$scope.gotoBottom = function() {
// set the location.hash to the id of
// the element you wish to scroll to.
$location.hash('bottom');
// call $anchorScroll()
$anchorScroll();
};
【问题讨论】:
-
跟文档一样,还要贴吗?
-
请。因为有些东西不适合你。
-
发帖,如果有更多需要我也会发帖。
-
@Chinni 发布,该功能正在运行,只是无法摆脱我网址末尾的##。
-
所以你不想要那个
##ID?