在angularjs中,我使用 $ location.hash('id_bottom'); 向下滚动到页面底部。它非常快速和跳跃。有没有办法使用angularjs很好地向下滚动,即更慢? (动画?)。
如果是这样,有人可以告诉我如何实现这一目标吗?
答案 0 :(得分:0)
这是使用jQuery的情况。如果您使用的是jQuery,请查看this question和this plugin的答案。您甚至可以将调用包装到Angular服务中,因此您可以使用以下内容:
app.controller("...", function($scope, scrollTo) {
...
scrollTo("id_bottom");
...
});