Problem with effect on multiple LIs

1

I have 4 li , 2 of them are appearing on the site, and another two will appear only when I click on any of the other two, for you to understand better, follow my code:

$(".membrosClick").click(function() {
  $(".listagemEsc").show();
});
$(".membrosFechar").click(function() {
  $(".listagemEsc").hide();
});
.membros {
  position: relative;
  width: 1120px
}
.membros li {
  float: left;
  cursor: pointer;
}
.membros li>div.subir>h2 {
  font-family: "bebasneue_regular";
  font-size: 67.99px;
  color: #ffffff;
  text-transform: uppercase;
  margin-top: 350px;
  margin-left: 65px;
  height: 59px;
  line-height: 59px;
}
.membros li>div.subir>h3 {
  font-family: "bebasneue_light";
  font-size: 67.99px;
  color: #ffffff;
  text-transform: uppercase;
  margin-left: 65px;
  height: 59px;
  line-height: 59px;
}
.membros li:hover .barraNone {
  display: block;
}
.membros li:hover .subir {
  margin-top: -10px;
}
<li class="editable membrosClick" name="Listagem de Membros" style="background-image: url('./imagens/membro1.jpg'); width:383px; height:849px">
  <div class="subir">
    <h2>Antônio</h2>
    <h3>Guerra</h3>	
  </div>
  <div class="bandaBarra bandaBarraBranca margin-left-65 margin-top-10 barraNone"></div>
</li>
<li class="listagemEsc p-relative">
  <div class="membrosFechar"></div>
  <span>Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo.</span>
</li>
<li class="editable membrosClick" name="Listagem de Membros" style="background-image: url('./imagens/membro2.jpg'); width:383px; height:849px">
  <div class="subir">
    <h2>Antônio</h2>
    <h3>Guerra</h3>	
  </div>
  <div class="bandaBarra bandaBarraBranca margin-left-65 margin-top-10 barraNone"></div>
</li>

What should happen: When I click on the% members_Click the li on the listingEc side should appear. Okay, this is happening, only all the listingEsc of the site appear. Should I use li , parent ? in Jquery?

    
asked by anonymous 04.02.2015 / 23:06

1 answer

3

If li are followed (siblings) you can use .next() that selects the next sibling of that element. Example:

$(".membrosClick").click(function () {
    $(this).next().toggle();
});

jsFiddle: link

    
04.02.2015 / 23:22