如何在AngularJS中滚动块div?
我使用如何在AngularJS中滚动块div?,angularjs,smooth-scrolling,Angularjs,Smooth Scrolling,我使用ngSmoothScroll: 但此代码滚动页面,而不是阻止: var element = document.getElementById('bottomDialog'); smoothScroll(element); HTML: .... 您正在使用的库不会执行您想要的操作,它只会滚动到指定的元素 请尝试使用以下其中一种方式: 我认为不起这样的作用。这可以工作,但会再次滚动页面:如果=“{{$last}}”duration=“2500” <div id="list">
ngSmoothScroll
:
但此代码滚动页面,而不是阻止:
var element = document.getElementById('bottomDialog');
smoothScroll(element);
HTML:
....
您正在使用的库不会执行您想要的操作,它只会滚动到指定的元素
请尝试使用以下其中一种方式:
我认为不起这样的作用。这可以工作,但会再次滚动页面:如果=“{{$last}}”duration=“2500”
<div id="list">
<div></div>
<div></div>
<div></div>
....
<div id=bottomDialog"></div>
</div>
// Inside ng-repeat
<div smooth-scroll scroll-if="{{ $last }}" duration="2500">{{...}}</div>