Ecodev / natural-gallery-js

A lazy load, infinite scroll and natural layout list gallery
https://ecodev.github.io/natural-gallery-js/
MIT License
134 stars 26 forks source link

Incorrect image size calculations in the case of few (<3) images in the gallery #65

Open akaliutau opened 3 years ago

akaliutau commented 3 years ago

Steps to reproduce:

  1. Create a simple gallery according to Getting started steps
  2. Add 2 images to the gallery

Expected result: 2 images displayed Actual result: Thumbnails in the gallery are not displayed due to incorrect calculation of size,

Here is the piece of generated page related to this issue (width and height are zero):

<div class="natural-gallery-body">
    <div class="zoomable figure loaded" style="background-color: rgba(0, 112, 243, 0.067); width: 0px; height: 0px; margin-bottom: 20px; margin-right: 0px;">

If to add more images (3 or 4), issue disappears