miromannino / Justified-Gallery

Javascript library to help creating high quality justified galleries of images. Used by thousands of websites as well as the photography community 500px.
http://miromannino.github.io/Justified-Gallery/
MIT License
1.68k stars 298 forks source link

Is it posibble to dynamically change the row height on page resize? #356

Open isaacfink opened 3 years ago

isaacfink commented 3 years ago

I want the row height to be a ratio of the full width but in resize it needs to Ernst how can I achieve that?

damott commented 1 year ago

Did you ever find a solution? I was just trying to work with justified gallery in combination with lightgallery so that I could change the rowHeight in justified gallery for different screen sizes. I tried the following code, which worked to change the sizes, but it somehow disabled the close button inside lightgallery.

`$(document).ready(function() { $("#animated-thumbnails-gallery") .justifiedGallery({ captions: false, rowHeight: 500, margins: 5 })

.on("jg.complete", function () {
  var screenWidth = $(window).width();
  var customRowHeight = screenWidth > 768 ? 500 : 300;
  $("#animated-thumbnails-gallery").justifiedGallery({
    rowHeight: customRowHeight
  });
  window.lightGallery(
    document.getElementById("animated-thumbnails-gallery"),
    {
      mode: 'lg-fade',
      download: false,
            thumbnail: false,
            hideBarsDelay: 2000,
      autoplayFirstVideo: false,
      pager: false,
      galleryId: "nature",
      plugins: [lgZoom, lgThumbnail],
      mobileSettings: {
        controls: false,
        showCloseIcon: false,
        download: false,
        rotate: false
      }
    }
  );
});

});`