Simple Mask Layer Effect, user login Display Effect

Source: Internet
Author: User

<! 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

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.