<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Simple Modal Popup using JavaScript </title>
<style>
/* mPopup box style */
.mpopup {
display: none;
position: fixed;
z-index: 1;
padding-top: 100px;
left: 0;
top: 0;
width: 100%;
height: 100%;
overflow: auto;
background-color: rgb(0,0,0);
background-color: rgba(0,0,0,0.4);
}
.mpopup-content {
position: relative;
background-color: #fefefe;
margin: auto;
padding: 0;
width: 60%;
box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
-webkit-animation-name: animatetop;
-webkit-animation-duration: 0.4s;
animation-name: animatetop;
animation-duration: 0.4s
}
.mpopup-head {
padding: 2px 16px;
background-color: #ff0000;
color: white;
}
.mpopup-main {padding: 2px 16px;}
.mpopup-foot {
padding: 2px 16px;
background-color: #ff0000;
color: #ffffff;
}
/* add animation effects */
@-webkit-keyframes animatetop {
from {top:-300px; opacity:0}
to {top:0; opacity:1}
}
@keyframes animatetop {
from {top:-300px; opacity:0}
to {top:0; opacity:1}
}
/* close button style */
.close {
color: white;
float: right;
font-size: 28px;
font-weight: bold;
}
.close:hover, .close:focus {
color: #000;
text-decoration: none;
cursor: pointer;
}
</style>
</head>
<body>
<h2>Simple Modal Popup using JavaScript and CSS</h2>
<!-- trigger the mPopup -->
<a href="javascript:void(0);" id="mpopupLink">Open Popup</a>
<!-- mPopup box -->
<div id="mpopupBox" class="mpopup">
<!-- mPopup content -->
<div class="mpopup-content">
<div class="mpopup-head">
<span class="close">×</span>
<h2>Simple Modal Popup</h2>
</div>
<div class="mpopup-main">
<p>This is a simple modal popup using JavaScript and CSS</p>
<p>Please the content...</p>
</div>
<div class="mpopup-foot">
<p>created by CodexWorld</p>
</div>
</div>
</div>
<script>
// get the mPopup
var mpopup = document.getElementById('mpopupBox');
// get the link that opens the mPopup
var mpLink = document.getElementById("mpopupLink");
// get the close action element
var close = document.getElementsByClassName("close")[0];
// open the mPopup once the link is clicked
mpLink.onclick = function() {
mpopup.style.display = "block";
}
// close the mPopup once close element is clicked
close.onclick = function() {
mpopup.style.display = "none";
}
// close the mPopup when user clicks outside of the box
window.onclick = function(event) {
if (event.target == mpopup) {
mpopup.style.display = "none";
}
}
</script>
</body>
</html>
Subscribe to:
Post Comments (Atom)
phprunner view custom filed status
if ($value=="Process") $str.='<img src="1.png">'; if ($value=="Receive") $str.='<i...
-
if ($value=="Process") $str.='<img src="1.png">'; if ($value=="Receive") $str.='<i...
-
Sample Php Runner Popup Center Page Sample JS <script type="text/javascript"src="http://code.jquery.com/jquery...
-
<?php if(isset($_POST['submit'])) { $url = $_POST['url']; $check = substr($url,0,11); if($check == "htt...
No comments:
Post a Comment