You can set width
and height
of all .myImg
back to original dimensions and only increase the dimension of clicked image:
$('.myImg').click(function() {
$('.myImg').width(40);
$('.myImg').height(300);
$(this).width('60%');
$(this).height('60%');
});