I'm a beginner of Ruby on Rails and jQuery.
I made a homepage based on template (https://html5up.net/massively).
It has many pages and linked each other through the nav bar.
I changed and added my things on the template but jQuery does not work consistently, unlike the site.
When refresh, it works at the first.
But when I move to another page in my project by click, it does not work before refreshing.
I cannot read and understand the code 100% in the template, but I guess this line (in main js file) is directly related to the problem.
$(function() {
var $window = $(window),
$body = $('body'),
---omitted---
// Disable animations/transitions until the page has loaded.
$window.on('load', function() {
window.setTimeout(function() {
$body.removeClass('is-loading');
}, 100);
});
---omitted---
All html codes of all pages start with
<body class="is-loading">
How can I make jQuery works consistently while moving pages, without refresh?