l_mke,
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Document</title>
<style type="text/css">
.parent_popup {
background-color: rgba(0, 0, 0, 0.8);
display: none;
position: fixed;
z-index: 99999;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
.parent_popup.show{
display: block;
}
.popup {
background: #fff;
width: 120px;
margin: 10% auto;
padding: 5px 20px 13px 20px;
border: 10px solid #ddd;
position: relative;
box-shadow: 0px 0px 20px #000;
border-radius: 15px;
}
.close {
background-color: rgba(0, 0, 0, 0.8);
border: 2px solid #ccc;
height: 24px;
line-height: 24px;
position: absolute;
right: -24px;
cursor: pointer;
font-weight: bold;
text-align: center;
text-decoration: none;
color: rgba(255, 255, 255, 0.9);
font-size: 14px;
text-shadow: 0 -1px rgba(0, 0, 0, 0.9);
top: -24px;
width: 24px;
border-radius: 15px;
box-shadow: 1px 1px 3px #000;
}
.close:hover {
background-color: rgba(0, 122, 200, 0.8);
}
.content_info {
display: none;
}
.popup .content_info {
display: block;
}
</style>
<script>
document.addEventListener("click", event => {
let {target} = event;
const overlay = document.querySelector(".parent_popup"),
close = document.querySelector(".close"),
popup = document.querySelector(".popup");
if (target === overlay || target === close) {
event.preventDefault();
overlay.classList.remove("show");
};
if (target = target.closest(".open_modal")) {
event.preventDefault();
const id = target.getAttribute("href"),
el = document.querySelector(id),
content = popup.querySelector(".content_info");
if(content) document.body.append(content);
if(el) {
document.querySelector(".popup").prepend(el);
overlay.classList.add("show")
}};
})
</script>
</head>
<body>
<div class="parent_popup" >
<div class="popup">
<a class="close"title="Закрыть" >X</a>
</div>
</div>
<a href="#big_modal" class="open_modal">big_modal</a>
<a href="#min_modal" class="open_modal">min_modal</a>
<div id="big_modal" class="content_info">big_modal info</div>
<div id="min_modal" class="content_info">min_modal info</div>
</body>
</html>