JSFiddle - React, Tailwind, and code Playground
HTML
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script>
<div class="add-defects-button">
<div class="defects-button"><button>Кнопка 1</button></div>
<div class="defects-forms">
<div class="defects-forms-head">
<span>Заголовок 1</span>
</div>
</div>
</div>
<div class="add-defects-button">
<div class="defects-button"><button>Кнопка 2</button></div>
<div class="defects-forms">
<div class="defects-forms-head">
<span>Заголовок 2</span>
</div>
</div>
</div>
CSS
.defects-button {
margin-bottom: 100px;
cursor: pointer;
display: block;
background: #64c9ca;
-webkit-border-radius: 50%;
border-radius: 50%;
height: 20px;
width: 20px; }
.defects-button .material-icons {
font-size: 17px;
display: block;
text-align: center;
height: 20px;
line-height: 20px;
color: #fff;
font-weight: bold; }
.defects-forms {
display: none;
opacity: 0;
position: absolute;
width: 250px;
left: 51px;
padding: 10px;
-webkit-box-shadow: 0px 24px 59px 0px rgba(51, 59, 69, 0.15);
box-shadow: 0px 24px 59px 0px rgba(51, 59, 69, 0.15);
background: #fff;
-webkit-border-radius: 10px;
border-radius: 10px;
margin-top: 5px;
z-index: 999; }
.defects-forms .textaria-form {
height: 100px; }
.defects-forms .textaria-form:focus {
border: 1px solid #7dcfa8; }
.defects-forms-head {
text-align: center;
text-transform: uppercase;
margin: 10px 0;
color: #626262; }
.defects-forms-show {
display: block;
opacity: 1; }
JavaScript
$('.defects-button').click(function(){
$('.add-defects-button .defects-forms').not(this).removeClass("defects-forms-show");
$(this).parents('.add-defects-button').children('.defects-forms').addClass('defects-forms-show');
return false;
});
$(document).click( function(event){
$(".defects-forms").removeClass("defects-forms-show");
});