Auto load content on scroll down

前端 未结 3 866
北恋
北恋 2021-02-09 14:49

I am creating a blog on django/webfaction. My hompage currently displays 4 posts by default (posts are limited to 4 on queryset in urls.py). Now I woul

3条回答
  •  囚心锁ツ
    2021-02-09 15:46

    You can make Ajax call to fetch more posts on 'onscroll' event of element (possibly on body in your case). You can make the same call using jquery's '.scroll()' documented here: http://api.jquery.com/scroll/

    You can probably maintain a previous-top statement to determine direction of current scroll.

提交回复
热议问题