<! Doctype HTML>
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312-8"/>
<Title> </title>
<Style>
# Content {
Width: 300px;
Height: 150px;
Padding: 10px;
Margin: 0 auto;
Display: none;
Line-Height: initial;
}
SPAN {
Width: 50px;
Margin-Right: 10px;
Border: 1px solid red;
}
</Style>
<SCRIPT>
Onload = function (){
VaR links = Document. getelementbyid ("login ");
VaR cancle = Document. getelementbyid ("cancel ");
VaR content = Document. getelementbyid ("content ");
Links. onclick = function (){
VaR cover = Document. createelement ("Div ");
Cover. ID = "cover ";
Cover. style. Left = 0;
Cover. style. Right = 0;
Cover. style. Top = 0;
Cover. style. Bottom = 0;
Cover. style. Position = "fixed ";
Cover. style. backgroundcolor = "# CCC ";
Cover. style. Opacity = "0.5 ";
Cover. appendchild (content );
Content. style. Display = "Block ";
Content. style. backgroundcolor = "white ";
Document. Body. appendchild (cover );
Return false;
};
// Cancel its remove the cover
Cancel. onclick = function (){
Document. Body. removechild (document. getelementbyid ("cover "));
};
// Login
Document. getelementbyid ("sub_ OK"). onclick = function (){
Formsub = Document. getelementsbytagname ("form") [0];
Formsub. Submit ();
Alert ("Login successful ");
Return false;
};
};
</SCRIPT>
</Head>
<Body>
<Form>
<Div>
<A href = "#" id = "login"> log on </a>
</Div>
<Div id = "content">
Name: & nbsp; <input type = "text" name = "name"/> <br/>
<Br/>
Password:
<Input type = "password" name = "psw"/>
<Div style = "margin: 5px;">
<Input type = "Submit" id = "sub_ OK" value = "Submit"/> & nbsp; & nbsp; <input type = "button" value = "Remove" id = "cancel"/>
</Div>
</Div>
</Form>
</Body>
</Html>
The Simple jump to the login page achieves the effect, but the submit is not triggered during the submission, but it does not violate today's topic. Thank you for your advice.
Simple Mask Layer Effect, user login Display Effect