javascriptruby-on-railsrubyparallaxskrollr

Skrollr not working in Ruby on Rails 4


I've included the gem and ran bundle which includes all the files in the gem lib perfectly fine.

application.js looks as such:

//= require jquery
//= require jquery_ujs
//= require skrollr
//= require skrollr.stylesheets
//= require turbolinks
//= require bootstrap-sprockets
//= require moment
//= require bootstrap-datetimepicker
//= require pickers
//= require_tree .

I've included this in the bottom of application.html.erb before the end of the body tag and also tried including in individual view as well:

<script type="text/javascript">
  $(function(){
    skroller.init();
  });
</script>

and for calling this in the view I used the example provided by skrollr:

<div data-0="background-color:rgb(255,0,0);" data-500="background- color:rgb(0,0,255);">
    WOOOT
</div>

but to my dismay I have not seen any effects. What could I possibly be missing?


Solution

  • <script type="text/javascript">
      $(function(){
        skrollr.init(); # skroller changed to skrollr
      });
    </script>