Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="[ Quand je clique la box suivante s'ouvre]">
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width">
  <title>contetn-box-open</title>
   <script src="https://code.jquery.com/jquery-1.9.1.js"></script>
</head>
<body>
  <div class="box1"> Ouvre-moi</div>
  <div class="box2"> OLÉÉ</div>
  <div class="box1"> Ouvre-moi 2</div>
  <div class="box2"> OLÉÉ</div>
   <div class="box1"> Ouvre-moi 3</div>
  <div class="box2"> OLÉÉ</div>
  <div class="box1"> Ouvre-moi 4</div>
  <div class="box2"> OLÉÉ</div>
</body>
 
</html>
 
body{
  display:flex;
  justify-content:center;
  flex-wrap:wrap;
}
.box1{
  padding:1%;
  text-align:center;
  width:auto;
  border:1px solid;
  background:lightyellow;
}
.box2{
  padding:1%;
  text-align:center;
  font-size:100px;
  width:100%;
  border:1px solid;
  display: none;
  background:YELLOW;
}
 
$(".box1").click(function(){
    $(this).next().toggle();
});
 $(".box2").click(function(){
    $(this).before().toggle();
 });
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
romain-Esa75pro
0viewers