0.0
No commit activity in last 3 years
No release in over 3 years
A jQuery plugin that does stuff to elements when they enter or leave the viewport
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.7
~> 10.0
 Project Readme

onScreen Rails Gem

Installation

Add this line to your application's Gemfile:

    gem 'onScreen-rails'

And then execute:

    $ bundle install

Usage

Add to your app/assets/javascripts/application.js

    //= require jquery.onscreen

Or for the minified version

    //= require jquery.onscreen.min

Example

Include jQuery and the plugin on a page.

$('elements').onScreen({
   container: window,
   direction: 'vertical',
   doIn: function() {
     // Do something to the matched elements as they come in
   },
   doOut: function() {
     // Do something to the matched elements as they get off scren
   },
   tolerance: 0,
   throttle: 50,
   toggleClass: 'onScreen',
   lazyAttr: null,
   lazyPlaceholder: 'someImage.jpg',
   debug: false
});

Documentation

Usage documentation as well as demos can be found at:

http://silvestreh.github.io/onScreen/

https://github.com/silvestreh/onScreen