0.01
No commit activity in last 3 years
No release in over 3 years
Add effect of infinite scroll on the page. Good replacement for traditional pagination.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
 Project Readme

Scrollinity

Add effect of infinite scroll on the page. Good replacement for traditional pagination.

Installation

Add this line to your application's Gemfile:

gem 'scrollinity'

And then execute:

$ bundle

Or install it yourself as:

$ gem install scrollinity

Usage

You have to require the scrollinity js file in your application.js manifest:

//= require scrollinity

On the page where you want to use the infinite scroll, you have to define some required variables. To do that, you have to set the data attributes to the element. Here is an example of such a page:

<div data-scrollinity-loading-pic="1" style="display: none">Loading...</div>

<div data-scrollinity-data-container="load_here" data-scrollinity-bottom-px-limit="50" data-scrollinity-path="/path/to/get/new/data"> 

<div id="load_here"></div>

data-scrollinity-loading-pic - define the element that should appear when user is waiting for the server response. Normally that would be an image with a spinning wheel.

data-scrollinity-data-container - define the id of the element to which the response from the server will be appended. In the example above, we load coming data to the div with an id "load_here".

data-scrollinity-bottom-px-limit - define the distance to the bottom of the page in pixels when should we start to load new data.

data-scrollinity-path - path to remote that will recieve an ajax call and return some data that will be appended.

Sample Application

You can find a sample application written on Rails 4 to demonstrate how the gem can be used: https://github.com/HeeL/scrollinity_sample_app