Implement a page wait effect similar to lightbox

Source: Internet
Author: User

<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = UTF-8"/>
<Title> untitled document </title>
<Style>
. Alpha65 {filter: alpha (opacity = 65); opacity: 0.65 ;}
</Style>
</Head>

<Body>
<Table width = "200" border = "1" id = "right_content_c">
<Tr>
<TD> ASD </TD>
<TD> ASD </TD>
<TD> ASD </TD>
</Tr>
<Tr>
<TD> ASD </TD>
<TD> ASD </TD>
<TD> ASD </TD>
</Tr>
<Tr>
<TD> ASD </TD>
<TD> ASD </TD>
<TD> ASD </TD>
</Tr>
</Table>
<Table width = "200" border = "1">
<Tr>
<TD> ASD </TD>
<TD> ASD </TD>
<TD> ASD </TD>
</Tr>
<Tr>
<TD> ASD </TD>
<TD> ASD </TD>
<TD> ASD </TD>
</Tr>
<Tr>
<TD> ASD </TD>
<TD> ASD </TD>
<TD> ASD </TD>
</Tr>
</Table>

<! -- Loading the mask -->
<Div style = "position: absolute; width: 100%; Height: 800px; Background-color: # FFF; display: none; Z-index: 20000; "Class =" alpha65 "id =" layer_loading ">
<Table Style = "width: 100%; Height: 100%;">
<Tr>
<TD align = 'center'> </TD>
</Tr>
</Table>
<IFRAME Style = "position: absolute; Z-index:-1;" width = "100%" Height = "100%" frameborder = "0" src = "about: blank "scrolling =" no "> </iframe>
</Div>
<! -- Background mask -->
<Div style = "position: absolute; width: 100%; Height: 800px; Background-color: # FFF; display: none; Z-index: 9999; "Class =" alpha65 "id =" layer_mask ">
<IFRAME Style = "position: absolute; Z-index:-1;" width = "100%" Height = "100%" frameborder = "0" src = "about: blank "scrolling =" no "> </iframe>
</Div>

<Input type = "button" value = "test" onclick = "test ()"/>
<Script language = "JavaScript" type = "text/JavaScript">
Function show_layer (node, mask ){
If (! Node |! Node. getattribute ('id ')){
Node = $ ('Right _ content_c ') | document. Body;
}

If (! Node ){
Return;
}

VaR div_top = node. offsettop | 0;
VaR div_left = node. offsetleft | 0;
VaR div_width = node. clientwidth + 2;
VaR div_height = node. clientheight + 2;
While (node = node. offsetparent) {div_top + = node. offsettop; div_left + = node. offsetleft ;}

With (mask. Style ){
Display = 'block ';
Position = "absolute ";
Left = div_left;
Top = div_top;
Width = div_width;
Height = div_height;
}
}

Function show_loading (node ){
Show_layer (node | $ ("right_content_c"), $ ('layer _ loading '));
}

Function show_mask (node ){
Show_layer (node | $ ("right_content_c"), $ ('layer _ mask '));
}
Function hide_mask (){
$ ('Layer _ mask'). style. Display = 'none ';
}
Function hide_loading (){
$ ('Layer _ loading'). style. Display = 'none ';
}
Function Test (){
Show_mask ();
Show_loading ();
}
 
Function $ (ID ){
Return document. getelementbyid (ID );
}
</SCRIPT>

</Body>
</Html>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.