Silent load of new URL on scroll [closed]

萝らか妹 提交于 2019-12-23 05:08:01

问题


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

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