Code Monkey home page Code Monkey logo

infinitescroll's Introduction

InfiniteScroll

It's a plug-in built using ECMAScript5 features and has NO dependency on any DOM manipulation libraries.

If you have a collection if items and you wish to display using

  • tags ex: twitter feed, then this plug-in will help you to reduce the DOM size.

    Just imagine, you have 10000 items to display without pagination at once. What if the web app is accessed on Mobile, it increases the size of the DOM.

    App will crash incase if the same scenario happens in Hybrid Mobile Application developed using Adobe PhoneGap.

    So, in this scenario, InifiteScroll will be handy!

    What InfiniteScroll is doing inside?

    It chunks the list items and display each chuck at a time based on the scroll position.

    Scroll Up: We remove elements from the top and add elements down in the list. Scroll Down: Viceversa operation of Scroll Up.

    With this at any point of time, we have fixed number of DOM elements is available in the browser inside the list.

    We are using DOMFragments to append the items to the list, so, DOM access will be minimal.

    Usage

    var infiScroll = new InfiniteScroll({

    wrapper:'container',    /*Manadatory : Parent element of the list, where the list is nested */
    
    itemsCollection:stack,  /*Mandatory: Array holds the li items */
    
    chunkItems:null         /*optional : function reference to chunk the items */
    

    });

    infiScroll.init();

    What's Next

    1. Ajax integration - live pulling of data from the server and appending to the list
    2. Integration with BackboneJS framework etc.,
    3. NodeJS compatability

    Connect with me

    Feel free to bug me incase of any issues!

  • infinitescroll's People

    Contributors

    roopeshchinnakampalli avatar

    Stargazers

    Nathan Querido avatar

    Watchers

    James Cloos avatar

    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.