Currently, this is the code I am working with. The JavaScript functionality is working well, however, there seems to be an issue where the image does not return to its original size on a second click. Additionally, I am having trouble getting the CSS to center the image.
function enlargeImg(img) {
img.style.transform = "scale(1.5)";
img.style.transition =
"transform 0.25s ease";
}
img {
position: relative;
margin-left: auto;
margin-right: auto;
width: 100%;
}
<div class="container">
<div class="heading">
<h3>Photo <span>Gallery</span></h3>
</div>
<div class="box">
<div class="dream">
<img src="./tucson/DSC03046.JPG" onclick="enlargeImg(this)">
<img src="./tucsonBW/nutsNBoltsBW.jpg">
<img src="./nature/deadTree.JPEG">
<img src="./nature/honeyBee.JPG">
<img src="./tucsonBW/mailBoxBW.jpg">
</div>