Infinite scrolling inside a div with AJAX (jQuery) loaded date

前端 未结 3 1005
野的像风
野的像风 2021-01-31 20:22

I\'ve been trying to figure this out over several questions here on SO, finding out the different parts and then assembling them, but now I\'m giving up.

What I\'m tryin

相关标签:
3条回答
  • 2021-01-31 20:30

    If you're using Paul Irish's Infinite Scroll, you can just specify a binder as one of the arguments where you have implemented infinite scroll, just like this:

    $('.mydiv').infinitescroll({
         binder: $(".name-of-div")  
    

    The binder is set to the document window by default, but if you specify it, you can have infinite scroll running simply inside one div on your page

    0 讨论(0)
  • 2021-01-31 20:34

    There are some plugins which do this for you quite well.

    http://www.webdeveloperjuice.com/2010/02/24/create-infinte-scroll-effect-using-jquery-with-demo/

    http://www.beyondcoding.com/2009/01/15/release-jquery-plugin-endless-scroll/

    EDIT: Some more up to date plugins:

    https://github.com/fredwu/jquery-endless-scroll

    http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/

    0 讨论(0)
  • 2021-01-31 20:40

    Use the JQuery.load() method to grab some html content and then insert it into an html element.

    0 讨论(0)
提交回复
热议问题