Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

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);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #delete #elment #javascript #fade
ADD COMMENT
Topic
Name
7+9 =