1.0.10 • Published 4 years ago
@atyoursite/animation v1.0.10
Animation
animateBody()
Description
Scroll the body to a given position. (cross browser). In the configuration you can opt to use a callback before or after the animation.
Installation
Open a terminal window inside the root of your project to install the node package.
npm install --save-dev @atyoursite/animation
Dependency
To be able to use the function, you will have to import it as a dependency
import { animateBody } from '@atyoursite/animation';
Usage
function runAfter() {
console.log('After scrolling');
}
function runBefore() {
console.log('Before scrolling');
}
animateBody({
scrollTop: 150,
duration: 2000,
cbBefore: runBefore,
cbAfter: runAfter
});