问题
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/
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?
回答1:
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
}
});
Look here: jQuery load more data on scroll
来源:https://stackoverflow.com/questions/43352118/silent-load-of-new-url-on-scroll