更改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