JSFiddle - React, Tailwind, and code Playground
HTML
<div id = "enter_foto">
<img class = "pic" src="images/stul/3.jpg" alt="image" />
<span>Другое фото</span>
</div>
CSS
#enter_foto {
background: #d9dabb;
margin: 20px 20px 10px 0;
padding: 5px 0;
text-align: center;
display: inline-block;
}
.pic
{
padding:0 0;
width: 140px;
height: 106px;
}
.select {
width: 650px;
height:500px ;
}
JavaScript
$(document).ready(function()
{
$('.pic').toggle(function(event)
{
var index = $('.pic').index(this);
var proba = '.pic:eq('+index+')';
$(proba).addClass('select');
},function (){
$('.pic').removeClass('select');
});
});