Copy codeThe Code is as follows:
Window. alert = function (str)
{
Var shield = document. createElement ("DIV ");
Shield. id = "shield ";
Shield. style. position = "absolute ";
Shield. style. left = "0px ";
Shield. style. top = "0px ";
Shield. style. width = "100% ";
Shield. style. height = document. body. scrollHeight + "px ";
// The background color in the pop-up dialog box
Shield. style. background = "# fff ";
Shield. style. textAlign = "center ";
Shield. style. zIndex = "25 ";
// Valid for background transparent IE
// Shield. style. filter = "alpha (opacity = 0 )";
Var alertFram = document. createElement ("DIV ");
AlertFram. id = "alertFram ";
AlertFram. style. position = "absolute ";
AlertFram. style. left = "50% ";
AlertFram. style. top = "50% ";
AlertFram. style. marginLeft = "-225px ";
AlertFram. style. marginTop = "-75px ";
AlertFram. style. width = "pixel PX ";
AlertFram. style. height = "150px ";
AlertFram. style. background = "# ff0000 ";
AlertFram. style. textAlign = "center ";
AlertFram. style. lineHeight = "150px ";
AlertFram. style. zIndex = "300 ";
StrHtml = "<ul style = \" list-style: none; margin: 0px; padding: 0px; width: 100% \ "> \ n ";
StrHtml + = "<li style = \" background: # DD828D; text-align: left; padding-left: 20px; font-size: 14px; font-weight: bold; height: 25px; line-height: 25px; border: 1px solid # F9CADE; \ "> [custom prompt] </li> \ n ";
StrHtml + = "<li style = \" background: # fff; text-align: center; font-size: 12px; height: 120px; line-height: 120px; border-left: 1px solid # F9CADE; border-right: 1px solid # F9CADE; \ ">" + str + "</li> \ n ";
StrHtml + = "<li style = \" background: # FDEEF4; text-align: center; font-weight: bold; height: 25px; line-height: 25px; border: 1px solid # F9CADE; \ "> <input type = \" button \ "value = \" Confirm \ "onclick = \" doOk () \ "/> </li> \ n ";
StrHtml + = "</ul> \ n ";
AlertFram. innerHTML = strHtml;
Document. body. appendChild (alertFram );
Document. body. appendChild (shield );
Var ad = setInterval ("doAlpha ()", 5 );
This. doOk = function (){
AlertFram. style. display = "none ";
Shield. style. display = "none ";
}
AlertFram. focus ();
Document. body. onselectstart = function () {return false ;};
}
Effect