angular.js - How to change the scroll bar position from the list page to the details page in angular to 0? Does angular have a built-in method?
PHP中文网
PHP中文网 2017-05-15 17:06:35
0
3
571

In a project built with angular, from the product list (such as scrollTop = 400) to the product details (scrollTop is still 400), the scroll bar position cannot go to the top, but remains at the position before the list page. How to make it go When setting the new content page, scrollTop = 0, please advise...

PHP中文网
PHP中文网

认证0级讲师

reply all(3)
世界只因有你

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

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template