• Resolved quimic

    (@quimic)


    Hi,
    I have a block of images that are laid out using masonry. Between each group of lazy loaded images, a big gap appears. If masonry is triggered again after all images are loaded (like if you resize your window) then everything goes back to normal, but the initial layout is broken.
    I suspect this is linked to image dimensions (and / or aspect ratio) not being properly calculated before they are actually loaded (and the other issue titled “Images overlapping in mansory” might be related as well).
    Do you make use of the “lazysizes aspectratio extension” in your plugin, which supposedly helps with that?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter quimic

    (@quimic)

    I noticed the “Keep original aspect ratio before the object is loaded.” which answers my question. Unfortunately, the theme I am using does not set the wdith and height attributes, so the aspect ratio is incorrect…

    Plugin Author Patrick Sletvold

    (@16patsle)

    @quimic That sounds about right. The masonry script can’t calculate if it doesn’t know the sizes of the images, and the aspectratio extension can’t calculate the aspect ratio if it doesn’t know the size either. This does depend on the theme, but there might also be room for improvement in how this plugin handles it. Please let me know if you find out anything or have any ideas for improvement in that regard.

    Best regards,
    Patrick Sletvold

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creates gap in layout with masonry’ is closed to new replies.