When I click on a particular button, I want to hide all other
Do you want something like this?
You don't need to add click handlers to each individual div.
Just get the index of the button clicked and show the div with that index.
$(document).ready(function() {
$(".poz button").click(function() {
var i = $(this).index();
$(".fichier").hide();
$(".fichier").eq(i).show();
});
});
.fichier {
display: none;
position: absolute;
top:0;
left:0;
height: 100%;
width: 100%;
}
.poz {
position: absolute;
width: 50%;
height: 64px;
overflow-x: scroll;
bottom: 0;
right: 0;
}
.btna {
width: 19%;
height: 50px;
}
.droite {
background: purple;
float: right;
width: 50%;
height: 100%;
}
.gauche {
background: orangered;
float: left;
width: 50%;
height: 100%;
}