更改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();
    });
};

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM