Skip to content

Instantly share code, notes, and snippets.

@772vjrvj
772vjrvj / slide.js
Created November 4, 2020 19:17 — forked from skttl/slide.js
Vanilla JS slideup slidedown slidetoggle
let fadeOut = (target, duration=500) => {
target.style.transitionProperty = 'opacity';
target.style.transitionDuration = duration + 'ms';
target.style.opacity = 0;
window.setTimeout( () => {
target.style.display = 'none';
target.style.removeProperty('opacity');
target.style.removeProperty('transition-duration');
target.style.removeProperty('transition-property');