Div:
< Div ID = "Winpop" >
< Div Class = "Title" > Operation Result: < Span Class = "Close" Onclick = "Tips_pop ()" > X </ Span > </ Div >
< Div ID = "Divoperateresult" Class = "Con" > </ Div >
</ Div >
JS:
< Script Type = "Text/JavaScript" >
// Pop-up layerCode, Call: tips_pop ()
Function Tips_pop (){
VaR Msgpop = Document. getelementbyid ( " Winpop " );
VaR Poph = Parseint (msgpop. style. Height ); // Converts an object height to a number.
If (Poph = 0 ){
Msgpop. style. Display = " Block " ; // Show hidden windows
Show = Setinterval ( " Changeh ('up ') " , 2 );
}
Else {
Hide = Setinterval ( " Changeh ('low ') " , 2 );
}
}
Function Changeh (STR ){
VaR Msgpop = Document. getelementbyid ( " Winpop " );
VaR Poph = Parseint (msgpop. style. Height );
If (Str = " Up " ){
If (Poph <= 100 ){
Msgpop. style. Height = (Poph + 4 ). Tostring () + " Px " ;
}
Else {
Clearinterval (show );
}
}
If (Str = " Down " )
{
If (Poph > = 4 )
{
Msgpop. style. Height = (Poph - 4 ). Tostring () + " Px " ;
}
Else
{
Clearinterval (hide );
Msgpop. style. Display = " None " ; // Hide Div
}
}
}
Window. onload = Function (){ // Load
Document. getelementbyid ( ' Winpop ' ). Style. Height = ' 0px ' ;
// SetTimeout ("tips_pop ()", 800); // call the tips_pop () function 3 seconds later.
}
</ Script >