I can't get my pop up to work properly. When I click the button, the screen dims as if a pop up is going to appear, but nothing shows up. Can someone please assist me with this issue?
Here is the HTML file:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href='https://fonts.googleapis.com/css?family=Varela+Round' rel='stylesheet' type='text/css'>
<link rel="stylesheet" type="text/css" href="css/main.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
</head>
<body>
<a href="#" class='btn open-modal' data-modal="#modal1">Open Modal</a>
<div class='modal' id='modal1'>
<div class='content'>
<h1 class='title'>This is a modal</h1>
<p>
Here is some text and stuff. cool cool
</p>
<a class='btn close-modal' data-modal="#modal1" href="#">K Bye</a>
</div>
</div>
<script
src="https://code.jquery.com/jquery-3.1.1.min.js"
integrity="sha256-hVVnYaiADRTO2PzUGmuLJr8BLUSjGIZsDYGmIJLv2b8="
crossorigin="anonymous"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js" integrity="sha384-Tc5IQib027qvyjSMfHjOMaLkfuWVxZxUPnCJA7l2mCWNIpG9mGCD8wGNIcPD7Txa" crossorigin="anonymous"></script>
<script type="text/javascript" src="script.js"></script>
</body>
</html>
Here is the CSS file:
* {
box-sizing: border-box;
}
body {
font-family: "Nunito", sans-serif;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.btn {
padding: 20px 50px;
display: inline-block;
background: #EF233C;
color: white;
text-decoration: none;
transition: 0.35s ease-in-out;
font-weight: 700;
}
.btn:hover {
background: #dc1029;
}
.overlay {
width: 100%;
min-height: 100vh;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
padding: 40px;
position: fixed;
top: 0;
left: 0;
background: rgba(0, 0, 0, 0.75);
opacity: 0;
pointer-events: none;
transition: 0.35s ease-in-out;
max-height: 100vh;
overflow-y: auto;
}
/* Remaining CSS code remains the same */
<p>JavaScript File:</p>
<pre><code>$(".modal").each( function(){
$(this).wrap('<div class="overlay"></div>')
});
/*Remaining javascript code remains the same*/