Git Product home page Git Product logo

Comments (7)

samcleaver avatar samcleaver commented on August 17, 2024

Heh, I don't know about integrating, its essentially what this plugin does (with the cool diagram on the side). Infinite-scroll's got competition!

from infinite-scroll.

lukeshumard avatar lukeshumard commented on August 17, 2024

maybe this could be an option that appends an element, #infscr-loading, to the page. the plugin would then append a child element for each page.

from infinite-scroll.

christophercliff avatar christophercliff commented on August 17, 2024

Hi guys -

Just to clarify quickly, sausage.js doesn't actually handle any lazy loading/infinite scroll functionality. It's designed to play nice with any implementation that uses this style of markup:

<div class="container-for-some-pages">
    <div class="page"></div>
    <div class="page"></div>
    <div class="page"></div>
    <!--
        Just insert more pages and update the sausage instance and you're good to go.
    -->
</div>

from infinite-scroll.

samcleaver avatar samcleaver commented on August 17, 2024

Ahh thanks for clarifying Christopher, I didn't have time to check out the source code and presumed it was handling the lazy loading as well. In that case I'm sure there's definitely a way we can integrate with sausage!

from infinite-scroll.

lukeshumard avatar lukeshumard commented on August 17, 2024

I talked this over briefly with Paul about a week ago. I think the best way to handle this is by using an attribute on the first element of the "page" with data-infscrpage="i", where i is equal to the page number.

Another idea is to create a variable in the callback that could be called on later, such as infscrPage001. This way, a search isn't fired each time a link is clicked, but instead calls on the "cached" variable.

Any opinions are appreciated. I'm hoping to program this out this week.

from infinite-scroll.

christophercliff avatar christophercliff commented on August 17, 2024

I did a rough example here:

https://github.com/christophercliff/sausage/blob/master/examples/infinite-scroll.html

Works out of the box, however the loading div will cause an extra little bubble above the last page added (sausage checks all child elements for simplicity). Not sure the best way to accommodate this.

from infinite-scroll.

lukeshumard avatar lukeshumard commented on August 17, 2024

Right, who's going to write the behavior for this one? I have a feeling this could be accomplished easily with the retrieve method or custom callback pretty easily.

from infinite-scroll.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.