【发布时间】:2014-04-06 06:40:50
【问题描述】:
我正在尝试在我的主页上实现无限滚动。但是,以下脚本将导致无限循环,因为 $(document).height() 永远不会改变。你能帮助我吗?我知道这是由 css 引起的,但我找不到解决方案。我尝试将代码都放入 $(window).load 和 $(document).ready 但它不起作用。
while( $(document).height() <= $(window).height() ) {
load();//load the data at the bottom of the homepage
}
谢谢
【问题讨论】:
-
我不认为
load是异步的? -
它使用 jquery 函数 $.get 所以我想是的,它是。