when you click on a div, a block with text should appear and the picture in this div should change. Such div 3 pieces and in the pictures inside the same class, how to make so that only that picture on which parental block was clicked changes. There is such a jquery sketch, the text comes up and the picture does not change:
function diplay_hide(blockId) { if ($(blockId).css('display') == 'none') { $(blockId).animate({ height: 'show' }, 500); $('this.arrow').attr("src", "images/up-arrow.png"); } else { $(blockId).animate({ height: 'hide' }, 500); } } <div class="span left" onclick="diplay_hide('#hidden_block');return false;"> <img src="images/photo.png" class="photo left" alt=""> <p class="px14">PHOTOGRAPHY</p> <label class="right" for="toggle"> <img src="images/down-arrow.png" class="arrow" alt=""> </label> <div class="hidden-text px14 grey" id="hidden_block"> Lorem ipsum dolor sit amet, consectetur adipiscing elit </div> </div>