inviktiv,
<!DOCTYPE html>
<html>
<head>
<title>Untitled</title>
<meta charset="utf-8">
<style type="text/css">
html, body {
height: 100%;
}
.btn {
border: 1px solid red;
padding: 5px 10px;
}
.btn-open {
background: #f00;
cursor: pointer;
}
.modal {
display: none;
background: rgba(0,0,0,0.7);
width: 300px;
}
.hide {
//display: none;
}
</style>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script>
$(function() {
$(document).on("click", function(event) {
var elem = $(event.target),
btn = $(".btn"),
popup = $(".modal");
if (elem.is(".btn")) {
event.stopPropagation();
var indx = btn.index(elem);
elem.toggleClass("btn-open btn-close");
popup.eq(indx).slideToggle()
} else if (elem.closest(popup).length) return;
else if (btn.is(".btn-close")) {
popup.slideUp();
btn.filter(".btn-close").toggleClass("btn-open btn-close")
}
})
});
</script>
</head>
<body>
<span class="btn btn-open">btn</span>
<ul class="modal">
<li>text1</li>
<li>text2</li>
<li>text3</li>
<li>text4</li>
<li>text5</li>
</ul>
<p></p>
<span class="btn btn-open">btn</span>
<ul class="modal">
<li>text1</li>
<li>text2</li>
<li>text3</li>
<li>text4</li>
<li>text5</li>
</ul>
</body>
</html>