向下滚动的动态HTML页面 [英] A dynamic HTML page scrolling down
本文介绍了向下滚动的动态HTML页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个使用引导程序jqxGrid构建的动态HTML页面,它调用一些服务器端代码来获取数据.加载数据后,将填充jqxGrid,页面向下滚动.
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.
我搜索了关键字"scroll",但没有找到任何内容.
I searched keyword "scroll" and did not find anything.
我的问题是一个普遍的问题:什么样的JS代码/css可以导致页面向下滚动?
My question is a general question: what kind of JS code/css could lead the page to scroll down?
谢谢!
推荐答案
$("html, body").animate({scrollTop: "2500"}, 1000); //smooth scrolling 2500px down
当然,您可以通过编写以下内容滚动到html中的任何元素:
Of course you can scroll to whatever element in your html by writing:
scrollTop: $(element).offset().top
这篇关于向下滚动的动态HTML页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文