Issue
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
Solution
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;
Answered By - Rashedul Islam
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.