330 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+2 more
PaulWinslow says

Calling all wizard developers..

I’m wanting to achieve this layout with Masonry..

https://www.dropbox.com/s/e21f262j62z9td1/masonry.png?dl=0

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!

Cheers, Paul

1483 posts
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Made it to the Authors' Hall of Fame
+3 more
OriginalEXE says

Hi Paul,

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.

4323 posts Community Mod Building awesome stuff for your mobile devices!
  • Has referred 100+ members
  • Has sold $125,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 1+ items on Envato Market
+14 more
Enabled Moderator says

I’ve edited your title [Devs] is the author’s call sign for Envato’s Developer team, usually when something’s wrong and need their assistance!

491 posts WordPress Gurus!
  • Has referred 200+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 50+ items on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+3 more
ThemeBeans says

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.

330 posts
  • Has been part of the Envato Community for over 4 years
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 100+ items on Envato Market
+2 more
PaulWinslow says

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.

1337 posts How's the surf doing?
  • Has referred 200+ members
  • Has sold $500,000+ on Envato Market
  • Has been a beta tester for an Envato feature
  • Has collected 10+ items on Envato Market
+6 more
tommusrhodus says

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.

2 posts
  • Sells items exclusively on Envato Market
  • Located in Egypt
Ghranek says

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

by
by
by
by
by
by