Skrollr is a stand-alone parallax scrolling library for mobile and desktop.
The skrollr-rails gem integrates skrollr with the Rails asset pipeline for ease of use and version control.
Add this line to your application's Gemfile:
gem 'skrollr-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install skrollr-rails
This gem provides four javascript files you can include in your app/assets/javascripts/application.js
file.
The skrollr core file. That's all you need for modern desktop browsers.
//= require skrollr
Skrollr IE Plugin
For IE < 9, include it after the core using conditional comments. The plugin makes IE understand opacity, rgb() and hsl() (the ones with alpha are mapped to them) and it creates a very simple document.querySelector polyfill which only supports ID selectors (using getElementById). Needed if you want to use data-anchor-target.
//= require skrollr
//= require skrollr.ie
Skrollr Menu Plugin
This plugin makes hashlinks scroll nicely to their target position.
//= require skrollr
//= require skrollr.menu
Skrollr Stylesheets Plugin
This plugin allows separation of skrollr keyframes and the document by putting them inside your stylesheets.
//= require skrollr
//= require skrollr.stylesheets
The version number of the skrollr-rails gem corresponds directly with the skrollr library.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Submit a new Pull Request