Installation
barba.js supports AMD, CommonJS and Browser global (using UMD).
You can install it using npm:
or just include the script in your page:
barba.js needs to know a little bit about your DOM structure. By default, it uses this markup structure in your pages:
Please note, all the selectors (#barba-wrapper, .barba-container) are easily editable - see the Dom API section.
After you've included barba.js in your project it's time to initialize it: