For my site, if there is a larger image that can be shown (like zoom in) the product has a magnifying glass below it that adds 30px
to the height of the container. So now, if you have a page where some images don't have larger images the thumbnails will all look un-even.
HTML Markup -
<div class="parent">
<a class="itemImage">
<img src="someImage.jpg"/>
</a>
<a class="magnify"> <!-- This element is only generated if a larger image is available -->
<img class="itemEnlarge" src="magnifyingGlass.jpg"/>
</a>
</div>
So here are the max-dimensions of `someImage.jpg -
- With Magnifying Glass: 200px x 100px (WxH)
- Without Magnifying Glass: 200px x 130px (WxH)
Is it possible to set the height of someImage
based on whether or not the magnify
element is generated?
I tried this, but I honestly don't even know what this will apply a css property to.
.parent .itemImage + a .itemEnlarge{max-height: 100px;}