如何只滚动特定的div-而不滚动整个页面-Angular?

时间:2018-09-29 07:33:55

标签: css angular

每当我单击scrollMe(目标)时,整个页面也会向下滚动。

HTML

<div *ngFor="let channel of checkChannelsService.channels">
  <div (click)="scrollMe(target)">
   {{channel.name}}
  </div>
</div>
<div #target *ngFor="let industry of channel.industries">
  {{industry.name}}
</div>

TS

 scrollMe(el) {
   el.scrollIntoView();
 }

0 个答案:

没有答案