Skip to content

calvinl/jquery-scrollLoader

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

jQuery (Infinite) scrollLoader

scrollLoader is a jQuery plugin for infinite scrolling. It’s very light weight allowing for a wider range of backend implementations of infinite scrolling to be possible. It simply wraps jQuery’s $.ajax() method and calls the specified url when scrolling hits the bottom of the page.

Requirements

scrollLoader requires jQuery UI’s Widget Factory plugin.

Usage

  $('#container').scrollLoader({
    ajaxType: 'get',
    ajaxUrl : '/photos.json',
    success : function(data) {
      // build your views here!
    }
  });

Options

loadFirstbool – Loads the first page of data immediately after the plugin is called. Good for showing the first page of stuff without having to scroll first. Default: true

scrollElemdom element – The element to bind the scroll event to. Default: window

ajaxTypestring – Same as type for $.ajax(). Default 'get'
ajaxDataobject – Same as data for $.ajax().
ajaxUrlstring - Same as @url for $.ajax().

limitint – Sent via AJAX as a parameter if ajaxData is not specified. Default

successfunction – Callback function when AJAX finishes. Same as success callback for $.ajax().

allowOvershootbool – Allow loading when the scrolling overshoots the size of the document. (Happens on devices with inertial scrolling, e.g. iOS, Mac OSX.)

About

A jQuery plugin for infinite scrolling.

Resources

Stars

Watchers

Forks

Packages

No packages published