Skip to content

Instantly share code, notes, and snippets.

@yogeshdubey2006
Created March 27, 2019 06:53
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yogeshdubey2006/b8915284f0443f48c6cede2986015064 to your computer and use it in GitHub Desktop.
Save yogeshdubey2006/b8915284f0443f48c6cede2986015064 to your computer and use it in GitHub Desktop.
Magento 2- Add animation to sections on scroll and Preloader
<!-- 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