84669 person learning
152542 person learning
20005 person learning
5487 person learning
7821 person learning
359900 person learning
3350 person learning
180660 person learning
48569 person learning
18603 person learning
40936 person learning
1549 person learning
1183 person learning
32909 person learning
angular构建的项目,从商品列表(比如 scroolTop = 400)转到商品详情(scrollTop还是 400),滚动条位置不能到最顶部,而是保持在列表页之前的的位置,怎么让转到新内容页的时候 scrollTop = 0,请教........
认证0级讲师
Set document.body.scrollTop=0 directly after the jump.
Angular is born to control the DOM of the page~, so there is nothing wrong with directly setting the value of scrollTop when you write it.
Thank you everyoneBut I don’t know if there is Angular’s own processing method. I would like to add that the monitoring route is processed uniformly, as shown in the picture above
Set document.body.scrollTop=0 directly after the jump.
Angular is born to control the DOM of the page~, so there is nothing wrong with directly setting the value of scrollTop when you write it.
Thank you everyone
But I don’t know if there is Angular’s own processing method. I would like to add that the monitoring route is processed uniformly, as shown in the picture above