Git Product home page Git Product logo

infinitescroll's Introduction

jQuery Infinite Scroll


Demo

http://www.21studio.com/infiniteScroll

What's new in version 1.2

  1. Now support bower, just type bower install infiniteScroll

What's new in version 1.1

  1. Adding event hooks
  2. Adding property enable
  3. jQuery No Conflict Support

How to use

HTML
  <div id="wrapper">
    <p>Line 1</p>
    <p>Line 2</p>
    <p>Line 3</p>
    <a class="url" data-href="http://yourweb/yourfile.php">
  </div>

Calling jQuery Infinite Scroll

  $('#wrapper').infiniteScroll();

yourfile.php

  if(allDataHaveBeenLoaded()){
    echo 'done';
  }
  else{
    //whatever you want to display
  }

To disable it, just do

  $("#wrapper").infiniteScroll({enable:false});

Available Options

Options Explanations Default
classNextSelector Class Selector to fetch next data .url:last
dataAttributeNextSelector Data attribute that containing url to fetch next data href
enable Enabling jQuery Infinite Scroll true
resultWord The word that telling jQuery Infinite Scroll that all data have been loaded done
loading Something you want to display when jQuery Infinite Scroll fetch next data <div class="loading" style="text-align:center;">Loading...</div>
classLoading The class of something you want to display when jQuery Infinite Scroll fetch next data loading
startAt The position of scroll bar to start fetch next data (0 <= startAt <= 1) 1
animation The animation of displaying next data (available animation : fade or slide) fade
animationSpeed The speed of your animation, it can be slow, fast, or speed of millisecond slow
done Something you want to display when all data have been loaded <div style="text-align:center;">It\'s done.</div>

Event Hooks

Event Explanations
onLoad Doing something when loading next data
success Doing something when loading is success
onFinish Doing something when all data have been loaded

infinitescroll's People

Contributors

sandi-racy avatar

Stargazers

Roberto Salas avatar

Watchers

 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.