更改alert弹出窗默认样式

alert弹出框

window.alert = function(data, funcOk) {
    $("body").append('<div class="boxHeightAuto" id="alert_wrap"><p>' + data + '</p></div>');
    var tanchuWidth = $('#alert_wrap').width();
    var tanchuHeight = $('#alert_wrap').height();
    $('#alert_wrap').css({
        'position': 'fixed',
        'margin-left': -tanchuWidth / 2.,
        'margin-top': -tanchuHeight / 2
    });

    tanchuWidth = $('#alert_wrap').width();
    tanchuHeight = $('#alert_wrap').height();
    $('#alert_wrap').css({
        'margin-left': -tanchuWidth / 2.,
        'margin-top': -tanchuHeight / 2
    });
    function run2() {
        $('#alert_wrap').remove();
    }
    window.setTimeout(run2, 1000)
    //确认默认回调
    if (typeof(funcOk) == 'undefined') {
        funcOk = function() {}
    }
    $('#alert_confirm').click(function() {
        $('#alert_tanchu,#big_div2').remove();
        funcOk();
    });
};
原文地址:https://www.cnblogs.com/ourLifes/p/7772686.html