Answers for "delete elment javascript after fade out"

1

delete elment javascript after fade out

function removeFadeOut( el, speed ) {
    var seconds = speed/1000;
    el.style.transition = "opacity "+seconds+"s ease";

    el.style.opacity = 0;
    setTimeout(function() {
        el.parentNode.removeChild(el);
    }, speed);
}

removeFadeOut(document.getElementById('test'), 2000);
Posted by: Guest on May-04-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language