Skip to content
This repository was archived by the owner on Jan 30, 2021. It is now read-only.

.destroy

Alper Kürşat edited this page May 24, 2018 · 1 revision

.destroy( start, duration ) => Promise

Arguments Type Unit Default Description
start Number ms 0 When .destroy class be added
duration Number ms 300 Time between class addition and item removal

It adds destroy class to the Element start ms after call. Then removes the Element from document after duration.

Reasonable when with a CSS rule like:

.destroy {
    opacity: 0;
    transition: .3s cubic-bezier(0.9, -0.5, 1, 1);
    transform: scale(.0);
}

duration should be equal to CSS property, transition-duration

This method returns Promise which will be solved after Element removal.

Clone this wiki locally