Skip to content

Instantly share code, notes, and snippets.

View mathmul's full-sized avatar
🤓
Always trying to learn stuff

Matej mathmul

🤓
Always trying to learn stuff
View GitHub Profile
@skttl
skttl / slide.js
Last active February 24, 2023 07:47
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');