Heim > Artikel > Web-Frontend > 用Jquery重写windows.alert方法实现思路_jquery
已经在 IE8 , firefox3.0.11下面测试通过
";
divalert += "
";
divalert += " ";
divalert += " ";
divalert += "";
$("body").append(divalert);
function showAlert(info)
{
alertQueue.push(info);
if (IsFirstAlert)
{
IsFirstAlert = false;
OpenAlert();
}
}
$("#alertClose").click(function()
{
$('#divAlert').CloseDiv()
if (alertQueue.length > 0)
{
setTimeout(OpenAlert, 150);
}
});
function OpenAlert()
{
$("#spaAlertMessage").html(alertQueue[0]);
alertQueue.splice(0, 1);
$("#divAlert").OpenDiv();
}
});