A dynamic HTML page scrolling down

本小妞迷上赌 提交于 2019-12-12 05:59:32

问题


I have a dynamic HTML page built with bootstrap, jqxGrid, calling some server side code to get data. After loading the data, jqxGrid populated, the page scrolls down.

Getting the code from a different developer, not sure where/what caused the page scrolling down.

I searched keyword "scroll" and did not find anything.

My question is a general question: what kind of JS code/css could lead the page to scroll down?

Thanks!


回答1:


$("html, body").animate({scrollTop: "2500"}, 1000); //smooth scrolling 2500px down

Of course you can scroll to whatever element in your html by writing:

scrollTop: $(element).offset().top



回答2:


Look for something like:

<a href="#anchor">Link Text</a>

in your html code and quite possibly some javascript that is accessing it and causing the scroll.



来源:https://stackoverflow.com/questions/44577370/a-dynamic-html-page-scrolling-down

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!