Skip to content

twoweb/onScreen-rails

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published