ES6 slideUp & slideDown Library

Category: Animation , Javascript | July 24, 2018
Author:janrembold
Views Total:2,097 views
Official Page:Go to website
Last Update:July 24, 2018
License:MIT

Preview:

ES6 slideUp & slideDown Library

Description:

A slideUp & slideDown JavaScript library written in ES6 that can be used to animate the height of the matched elements without the need of jQuery library.

How to use it:

Install the es6-slide-up-down with package managers.

# Yarn
$ yarn add es6-slide-up-down
# NPM
$ npm install es6-slide-up-down --save

Import the ‘es6-slide-up-down’.

import {slideUp, slideDown} from 'es6-slide-up-down';

Apply slideUp and slideDown effects to an element you specify.

const element = document getElementById('MY-Element');
slideUp(element);
slideDown(element);

Customize the duration of the sliding animation.

slideUp(element,{
  duration: 2000
});
// or
slideUp(element, 2000);
slideDown(element,{
  duration: 2000
});
// or
slideDown(element, 2000);

Apply an easing function to the sliding animation. Requires an extra easing library.

slideUp({
  easing: easeInQuint
});
slideDown({
  easing: easeInQuint
});

You Might Be Interested In:


Leave a Reply