I'm going to have several guitars on the site, depending on the categories, so I put them side by side, so when I click on one of the guitars, the one on the side generates an undesirable spacing,
HTML
<divclass="seg-nt">
<div class="caixa">
<span class="open-nt">esportes</span>
<div class="contentNT hide">
01
</div>
</div>
<div class="caixa">
<span class="open-nt">politica</span>
<div class="contentNT hide">
02
</div>
</div>
<div class="caixa">
<span class="open-nt">policial</span>
<div class="contentNT hide">
03
</div>
</div>
CSS
.show{display: block;}
.hide{display: none;}
.seg-nt{
padding: 00.80906148867314% 00.80906148867314%;
width: 100%;
overflow: hidden;
box-sizing: border-box;
}
.seg-nt .caixa{
position: relative;
float: left;
margin: 0% 00.80906148867314% 00.80906148867314% 0%;
padding: 00.80906148867314% 00.80906148867314%;
width: 49.55555555555555%;
border: 1px solid #e1e1e1;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
}
.seg-nt .caixa:nth-child(-n+2){margin: 0% 00.80906148867314% 00.80906148867314% 0%;}
.seg-nt .caixa:nth-child(2n){margin: 0% 0% 00.80906148867314% 0%;}
.seg-nt .caixa:last-child{margin: 0%;}
.seg-nt .caixa span{
position: relative;
display: block;
width: 100%;
height: 30px;
line-height: 30px;
font-size: 1.3em;
text-align: center;
text-transform: uppercase;
cursor: pointer;
}
.seg-nt .caixa .contentNT{
float: left;
height: 150px;
border-top: 1px solid #e1e1e1;
background-color: orange
}
JQUERY
$(function(){
$('.open-nt').click(function(){
var contentNT = $(this).parent().find('.contentNT');
if(!contentNT.hasClass('show')){
$('.caixa').find('.show').slideUp('fast', function(){
$(this).addClass('hide').removeClass('show');
});
contentNT.slideDown('fast', function(){
$(this).addClass('show').removeClass('hide');
});
}
});
});