Load skrollr.init in the correct way in Rails

0

I'm using Skrollr in a Rails application as follows:

Gem Used:

gem 'skrollr-rails'

app / assets / javascripts / application.js

//= require jquery
//= require jquery_ujs
//= require turbolinks
//= require bootstrap
//= require skrollr
//= require skrollr.menu
$(document).on("ready page:load", function () {
    var s = skrollr.init({
        smoothScrolling: false,
        mobileDeceleration: 0.004
    });

    skrollr.menu.init(s, {
        animate: true,
        scale: 2
    });
});

I have a main page where I have a parallax layout and a few other pages detailing some products and services.

The problem:

Init is done on the "ready": load "page, but when navigating between pages it stops working again only if I refresh the page. What can be done?

    
asked by anonymous 06.05.2015 / 19:08

1 answer

0

Being loaded correctly, to work just add the code as below:

// => skrollr.init()
s.refresh();

In this way Skrollr will be reloading page elements.

Official Documentation

    
06.05.2015 / 20:24