function showAlert(time) {
var alert_w = $(".alert").width();
$(".alert").fadeIn();
$(".alert").css({ "margin-left": -alert_w / 2 });
setTimeout(function () {
$(".alert").fadeOut();
}, time)
}
//公共的弹窗方法
function showMessage(time, text, url) {
var $newdiv = $("<div class='alert'></div>");
var div_html = '';
div_html += '<div class="alert_body">';
div_html += '<img src="/images/information.png" /> ';
div_html += '<span>' + text + '</span>';
div_html += '</div>';
$newdiv.append(div_html);
$('body').append($newdiv);
var alert_w = $newdiv.width();
$newdiv.fadeIn();
$newdiv.css({ "margin-left": -alert_w / 2 });
setTimeout(function () {
$newdiv.fadeOut(function () { $newdiv.remove(); });
if (url) {
window.location.href = url;
}
}, time);
}
公共的弹窗方法
最新推荐文章于 2024-04-09 15:22:48 发布