The js pop-up box replaces the browser pop-up box. For more information, see.
The Code is as follows:
Function fromID (id ){
Return document. getElementById (id );
}
Function show_alert (msg, type, time ){
Var layer_obj = fromID ("alert_layer ");
Var layer_text = fromID ("alert_text ");
Var line_height = (document.doc umentElement. scrollTop = 0 )? Document. body. scrollTop: document.doc umentElement. scrollTop;
Layer_text.innerHTML = msg;
With (layer_obj.style ){
ZIndex = 999;
Top = line_height-40;
Left = document. body. clientWidth/3;
Display = "block ";
Position = "absolute ";
If (type = "error "){
Background = "url (http: //" + style_domain + "/snake/index/msgbox_right_bg2.jpg )";
}
}
Layer_obj.filters [0]. opacity = "0.8"; // The transparency is 80%.
If (time = undefined) time = 3000;
Else time = time * 1000;
Var top = line_height-40;
Var speed = 1.5;
Time-= 1000;
// The control window moves down to the edge of the page
Move_down = function MoveFplogo (){
Top + = speed;
Layer_obj.style.top = top;
If (top <line_height) setTimeout ("move_down ()", 1 );
Else setTimeout ("close_alert_win ()", time );
}
Move_down ();
}
Function close_alert_win (){
Var layer_obj = fromID ("alert_layer ");
// The control window gradually disappears
If (layer_obj.filters [0]. opacity <0.02 ){
Layer_obj.style.display = "none ";
Return true;
}
Layer_obj.filters [0]. opacity-= 0.02;
SetTimeout ("close_alert_win ()", 1 );
}
Document. writeln ("filter: progid: DXImageTransform. Microsoft. BasicImage ();"> ");
Document. writeln ("");
Document. writeln ("");
Document. writeln ("");