I have a blog component with a scroll but when I close it and reopen it the scroll is where it was before, I need it to be shown again from above, how can I do it? I am using angular 12
CodePudding user response:
document.getElementById('container-3').scrollTop = 0;
add container-3 in your layout. or you can write in an angular way.
@ViewChild('container') private container: ElementRef;
this.container.nativeElement.scrollTop=0