372 posts Simple is the new black.
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been part of the Envato Community for over 5 years
  • Made it to the Authors' Hall of Fame
+4 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

1547 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
+2 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.

4863 posts Community Mod Building awesome stuff for your mobile devices!
  • Provided great contribution to our forums
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Achieved the monthly Community Superstar Award
+16 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!

621 posts WordPress Gurus!
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
  • Made it to the Authors' Hall of Fame
  • Won a Most Wanted contest
+5 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.

372 posts Simple is the new black.
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $75,000+ on Envato Market and is now an Elite Author
  • Has been part of the Envato Community for over 5 years
  • Made it to the Authors' Hall of Fame
+4 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.

1718 posts How's the surf doing?
  • Power Elite Author: Sold more than $1M on Envato Market
  • Has sold $1M+ on Envato Market and is now a Power Elite Author
  • Achieved the monthly Community Superstar Award
  • Made it to the Authors' Hall of Fame
+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.

4 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