335 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
+3 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

1504 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.

4563 posts Community Mod Building awesome stuff for your mobile devices!
  • Contributed a blog post
  • Elite Author: Sold more than $75,000 on Envato Market
  • Helps us moderate the forums
  • Has sold $125,000+ on Envato Market
+15 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!

572 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.

335 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
+3 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.

1542 posts How's the surf doing?
  • Nominated Community Superstar of the month
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has been part of the Envato Community for over 3 years
  • Had an item featured on Envato Market
+7 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

Helpful Information

  • 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.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by