I have just discovered Barba.js and find it very useful. It provides smooth transitions between URLs of the same website.
I have put together a Plunker consisting of two pages (index.html and about.html) that are loaded smoothly, with the help of jQuery's fadeIn()
and fadeOut()
methods.
I would like the About us page to not only be faded in, but scrolled down some 250px too.
For this purpose, I have:
- added a class to the html tag in the About Us page:
<html class="about">
added this in the script.js:
$('html.about, html.about body').animate({ scrollTop: 300 },1000);
Evan though the page scrolls if no class name selector is mentioned in the script, the version above does not work. But I want only the "About Us" page to be animated.
What shall I change?