381 posts Simple is the new black.
  • Weekly Top Seller
  • Elite Author
  • Author Level 7
  • 5 Years of Membership
+5 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

1565 posts
  • Affiliate Level 1
  • Author Level 5
  • Collector Level 2
  • Featured Author
+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.

4948 posts Community Mod Building awesome stuff for your mobile devices!
  • Trendsetter
  • Weekly Top Seller
  • Elite Author
  • Author Level 8
+17 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!

667 posts WordPress Gurus!
  • Author Level 9
  • Elite Author
  • Featured Author
  • Weekly Top Seller
+7 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.

381 posts Simple is the new black.
  • Weekly Top Seller
  • Elite Author
  • Author Level 7
  • 5 Years of Membership
+5 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.

1763 posts How's the surf doing?
  • Power Elite Author
  • Trendsetter
  • Top Monthly Author
  • Community Superstar
+10 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
  • Exclusive Author
  • Egypt
  • 1 Year of Membership
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