1701* Method fade out for IE8+1702*1703* @param {Node} element - element animation1704* @param {number} duration - speed animation1705* @param {Function} complete - call function after end animation1706* @returns {void}1707*/1708function t_fadeOut(element, duration, complete) {1709var elementStyle = getComputedStyle(element, null);17101711if (elementStyle.display === 'none' || elementStyle.opacity === '0') return;1712
duration = parseInt(duration); var opacity = 1; var speed = duration > 0 ? duration / 10 : 40; var timer = setInterval(function () { element.style.opacity = opacity; opacity -= 0.1; if (opacity <= 0.1) { clearInterval(timer); element.style.display = 'none'; element.style.opacity = null; if (typeof complete === 'function') { complete(); } } }, speed); }})();