bootstrap modal 弹出效果

window.showMsg = function (msg) {
    //显示悬浮窗
    $("#autoCloseModal").modal("show")
    //设置文本内容
    $("#autoCloseModal #autoCloseModalBody").html("")
    $("#autoCloseModal #autoCloseModalBody").html(msg);
    //两秒后消失
    setTimeout(function () { $("#autoCloseModal").modal("hide") }, 2000);
};



调用:

showMsg('成功!');

 

posted @ 2016-06-03 17:32  直钩钓鱼  阅读(876)  评论(0编辑  收藏  举报