Justified-Gallery icon indicating copy to clipboard operation
Justified-Gallery copied to clipboard

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

Open isaacfink opened this issue 3 years ago • 1 comments

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?

isaacfink avatar Jul 02 '21 23:07 isaacfink

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
      }
    }
  );
});

});`

damott avatar Feb 23 '23 17:02 damott