alert弹窗样式修改

Posted echolife

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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);
    }
})();

 

以上是关于alert弹窗样式修改的主要内容,如果未能解决你的问题,请参考以下文章