Created
March 27, 2019 06:53
-
-
Save yogeshdubey2006/b8915284f0443f48c6cede2986015064 to your computer and use it in GitHub Desktop.
Magento 2- Add animation to sections on scroll and Preloader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- AOS --> | |
Step 1: follow: https://michalsnik.github.io/aos/ | |
Step 2: Add | |
<link href="https://unpkg.com/aos@2.3.1/dist/aos.css" rel="stylesheet"> | |
<script src="https://unpkg.com/aos@2.3.1/dist/aos.js"></script> | |
Step 3: add jquery dependency (requirejs-config.js) | |
var config = { | |
shim: { | |
jquery: { | |
exports: '$' | |
}, | |
'js/owl.carousel.min': { | |
deps: ['jquery'] | |
}, | |
'js/aos': { | |
deps: ['jquery'] | |
}, | |
'js/custom': { | |
deps: ['jquery'] | |
} | |
}, | |
deps: [ | |
"js/custom" | |
] | |
}; | |
Step 4: custom.js | |
// INITIALIZE AOS | |
require([ | |
'js/aos' | |
], function (AOS) { | |
'use strict'; | |
AOS.init({ duration: 2000 }); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment