Calling all wizard developers..
I’m wanting to achieve this layout with Masonry..
But after my initial stumbling I haven’t quite worked out the fixed-height container with the two vertical images fitting together nicely to make that fixed height..
A nudge in the right direction would be greatly appreciated!
I’m not sure you could achieve something like that without cropping the images.
I mean, sure, you could set up a demo with images that fit so it looks like that, but in the real world where customers use all kinds of images, I doubt something like this is possible (at leas not without some kind of scroll, either horizontal or vertical.
I might be wrong though.
You would definitely need to have some sort of cropping action going on. Or even masking with CSS (max-height or something), by assigning classes to every other post (or whichever ones you needed). I did something similar to this with the masonry templates in Spaces (latest theme) – so that users will achieve a standard masonry look, even with disproportionate images.
Cheers for the replies, guys.
I did intend for some good old WP image cropping – I just can’t wrap my head around the auto-height cropping (probably based on the width for best results) while making sure the two together always came to the container’s height.
Here’s what I would do:
Set your masonry items heights using CSS, and apply your images is background images with background-size: cover, that way the image sizing will be automatically handled by the browser, and you can always guarantee the item size.
you can do it with jquery. get the two images height and sum them, and get one image percentage from the two images sum. then you can give the image an height from the container height equal to the % of it and the rest for the other image. you can do this for divs which parent of image and use re-size to container plugin to make in looks good
- Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
- Open a support ticket if you would like specific help with your account, deposits or purchases.
- Item Support by authors is optional and may vary. Please see the Support tab on each item page.
Most of all, enjoy your time here. Thank you for being a valued Envato community member.