How to create popup box for login form using jquery and css | Sanwebcorner

How to create popup box for login form using jquery and css

Today i am going to tell you how to create simple popup box for login or registration or other types of forms.The below image shows how the popup window is looks like, on click the login text it displays the popup window in this window you can put whatever you want, i used this box for my login form.

This is simple and easy to create and also user friendly. This will very helpful to display forms and other contents, This type of popup box also used to reduce the size of the webpages. I hope this post is useful.






Html for login popup box:

<body>
<div id="black_overlay" style="width: 100%;"> </div>
<div class="san-form">
<img src="images/m_close-icon.png" width="20" height="20" class="close" />
<h3>Login</h3>
<input type="text" id="uname" name="uname" placeholder="User Name">
<input type="password" id="password" name="password" placeholder="Password">
<input type="button" value="Submit" id="submit1">
</div>
<div style="background-color:pink; min-height:860px;">
<p class="Login">Login (Click Here)</p><br/>
<a href="http://wwww.sanwebcorner.com/">wwww.sanwebcorner.com</a>
</div>
</body>


Css for Login pop-up box:

body
{
background-color:pink;
}
#black_overlay {
background-color: #333;
left: 0;
opacity: 0.8;
position: absolute;
top: 0;
visibility: hidden;
width: 100%;
z-index: 50;
}

.san-form{
width:320px;
height:280px;
border:1px solid #8E404C;
padding:20px;
background-color:#FFDEE3;
border-radius:3px;
display:none;
text-align:center;
z-index:999;
position:fixed;
top:50%;
left:50%;
transform:translate(-50%,-50%);
}
.close {
float: right;
position: absolute;
right: -8px;
top: -10px;
cursor:pointer;
}

input{
width:92%;
margin:10px 0;
padding:5px;
height:35px;
border-radius:3px;
border: 1px solid #FFBFC9;
}
input#submit1{
width:100%;
margin:10px 15px 10px 0;
padding:5px;
background-color:#8E4F59;
border-radius:3px;
color:#fff;
height:41px;
font-size:16px
}
.Login {
text-align:center;
font-size:20px;
cursor:pointer;

}


Javascript for login popup box:

$(document).ready(function() {
$(".Login").click(function() {
var h = $("body").height() + 'px';
$("#black_overlay").css({"height":h,"visibility":"visible"});
$(".san-form").css('display','block');
});
$(".close, #submit1").click(function() {
$(".san-form").css('display','none');
$("#black_overlay").css("visibility","hidden");
});

});

Post a Comment

Labels

360 degree view product image 3d rotate 3d text 3step-form Accordion menu ajax All Browsers Animated Background Gradient animation audio controller auto complete Best accordion menu bootstrap border bounce effect on hover Breadcrumb calculate age by dob calendar Captcha change image on mouse move color chooser countdown Counter on scroll Css css animation css buttons css hover css3 customized upload Button Date picker delete data from table Different scroll speed email otp verification email verifier Embed eventlist Expanding Menu feedbck form flash news section close button full screen menu Google custom search Google Maps Google reCAPTCHA Google site search gradient hide menu Horizontal News ticker Hover Htm Html html dropdown html form html5 html5 form validation Iframe image hover increment decrement textbox value based on select box Javascript Jquery js Layered image effect on mouse hover lock & unlock page scroll marquee marquee with close button mobile number validation mobile otp login Multi-level-drop-down-menu multi-level-form Multi-Step-form mysql News ticker on hover change text to image our team page password strength checker Photoshop PHP populate html selectbox Popup image on click the link pure css Question type form Random password Redirect page Based on the select box while submit the form responsive responsive menu responsive popup box Responsive Vertical Time line design rotate image selectbox based on select box simple coming soon page simple countdown based on end date simple typing effect slider sliding tab sms otp login statistic counter on scroll switch tag shape team member Time picker toggle toggle view transparent button underline animation up down slide validation vertical fixed sidebar Webtips Youtube