alert弹窗样式修改

//弹窗提示
window.alerts = alerts = (function () {
    var _alrElem = document.createElement("div");
    _alrElem.className = "error_page";
    var textElem = document.createElement("div");
    textElem.className = "errorText";
    _alrElem.appendChild(textElem)
    return function (_t) {
        _t = _t || '';
        document.body.appendChild(_alrElem);
        textElem.innerHTML = _t;
        _alrElem.style.display = "block";
        var timer = setTimeout(function () {
            if (_alrElem) { document.body.removeChild(_alrElem); }
            clearTimeout(timer);
        }, 2000);
    }
})();

 

posted @ 2020-07-13 17:34  echolife  阅读(1519)  评论(0编辑  收藏  举报