本文介绍了滚动无提示加载新URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当滚动时,我一直看到静默加载页面的趋势.例如: http ://www.adweek.com/brand-marketing/as-soda-consumption-declines-heres-how-coca-cola-is-reshaping-itself/
I've been seeing this trend of pages silently loading as you scroll. For ex:http://www.adweek.com/brand-marketing/as-soda-consumption-declines-heres-how-coca-cola-is-reshaping-itself/
滚动到文章之后,将加载新文章,并且URL也会更改.
After you scroll past the article, a new article loads in and the URL changes.
浏览源代码,找不到任何东西.有什么想法吗?
Digging through the source code and can't find anything. Any ideas?
推荐答案
是的,这些限制是在寻找用户的脚本,并通过ajax加载新内容.
Yeah, those implemntations looks for the scrooling of the user and load new contents via ajax.
$(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height()) {
// ajax call get data from server and append to the div
// change url
}
});
查看此处: jQuery在滚动条上加载更多数据
这篇关于滚动无提示加载新URL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!