angular.js - angular从列表页到详情页的滚动条位置怎么改变为 0,angular可有内置方法?
PHP中文网
PHP中文网 2017-05-15 17:06:35
0
3
491

angular构建的项目,从商品列表(比如 scroolTop = 400)转到商品详情(scrollTop还是 400),滚动条位置不能到最顶部,而是保持在列表页之前的的位置,怎么让转到新内容页的时候 scrollTop = 0,请教........

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!