Coder Wrap provides free to use snippets Coder Wrap provides free to use snippets

Back to Popup & Model Popup
Preview Source Code
Download
HTML
CSS
/**Typeo CSS Start**/
body {font-family: Verdana, Geneva, sans-serif; }
*{
	padding: 0px; 
	margin: 0px; 
	box-sizing:
	border-box;
	text-decoration:none; 
	list-style:none;
}
.pupop-btn{background: #09F;
    font-size: 16px;
    color: #fff;
    padding: 10px 20px;
    display: flex;
    margin: auto;
    justify-content: center;
    cursor: pointer;
    max-width: 300px;
    margin-top: 10%;}
/**Typeo CSS End**/    
.popup-box{ 
	width:600px; 
	transition:all 1s ease 0s; 
	-webkit-transition:all 1s ease 0s; 
	margin:auto; 
	background:#CCC; 
	position:fixed; 
	top:-100%; 
	left:0px; 
	right:0px;
	pointer-events: none;
	z-index: 999;
}
.popup-box img{
	width: 100%;
}
 .close-btn{ 
 	cursor:pointer; 
 	float:right; 
 	width:30px; 
 	height:30px; 
 	text-align:center; 
 	background:#09F; 
 	line-height:30px; 
 	color:#fff;
 	position: absolute;
 	right: 0px;
 	top: 0px;
 }
.popup-bg{ 
	position:fixed; 
	transition:all 0.6s ease 0.6s;
	-webkit-transition:all 1s ease 0s;
	visibility:hidden; 
	opacity:0; 
	width:100%; 
	height:100%; 
	float:left; 
	background:rgba(0, 0, 0, 0.8);
	pointer-events: auto;
	top: 0px;
	z-index: 988;
}
.custom-popup .popup-bg{ 
	pointer-events: auto; 
	opacity:1; 
	visibility:visible;
}
.custom-popup .popup-box {
	pointer-events: auto;
	top: 50%;
	transform: translateY(-50%);
	-webkit-transform: translateY(-50%);
}
JS
function popupModel() {
  document.body.classList.add('custom-popup');
}
function popupModelClose() {
  document.body.classList.remove('custom-popup');
}

Related Snippets

Leave a comment

Your email address will not be published. Required fields are marked *