So i cant get the jquery correct for this one, whatever i try it returns the wrong width.
I wish to make the image within the “img-shadow” div the same size as the image right before it. Notice this will repeat several times on the page.
<p>
<img src="" alt="">
<span class="img-shadow">
<img src="" alt="">
</span>
</p>
I hope you don’t shake your heads too much on at me on this one, it seems super simple, but .prev .find .closest hasn’t worked for me.
Thanks!
Solution added:
Jquery
$(".img-shadow").each(function(){
$(this).children("img").width( $(this).parent().find('img').width() );
});
This should work, but I didn’t test it: