Continuous Looping Page (Not Infinite Scroll)

前端 未结 6 1394
忘掉有多难
忘掉有多难 2020-12-02 21:16

I\'m looking for resources that create scrolling functions like the ones found on these sites:
Outpost Journal
Unfold

Once the scroll bar hits the bottom

6条回答
  •  感动是毒
    2020-12-02 22:18

    mrida's answer was causing my browser to not be able to scroll, here is a modified version that worked for me:

      $('document').ready(function() {
        $(document).scroll(function(){
          if (document.documentElement.clientHeight + $(window).scrollTop() >= $(document).height()) {
            $(document).scrollTop(0);
          }
        });
      });
    

提交回复
热议问题