Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1314017

    Hi there,
    We’re having some trouble with images appearing blurry in masonry galleries on our site, both as thumbnails and in the lightbox. Can you please let me know what the best solution to resolve this is? Thanks!

    • This topic was modified 3 years, 3 months ago by jaimemerz.
    #1314838

    Hey jaimemerz,
    Thank you for your patience and for the link to your site, for the masonry gallery on the homepage I’m having trouble seeing the blurriness, perhaps it’s my screen or my eyes, but I do note that the image shown is a little smaller than the element size which could cause blurriness. Since the lightbox image is larger I wrote this script to use the larger image, please try adding this to your child theme functions.php and seeing if it helps.

    function custom_script() { ?>
        <script>
    (function($){
      $(".av-masonry-entry").each(function(){
          var imageUrl = $(this).attr("href");
          $(this).find(".av-masonry-image-container").css("background-image", "url(" + imageUrl + ")");
      });
      })(jQuery);
      </script>
        <?php
    }
    add_action('wp_footer', 'custom_script');

    Best regards,
    Mike

    #1314915

    Hi Mike,
    That appears to have worked! Thank you.
    Natalie

    #1314973

    Hi,

    I’m glad this was resolved. If you need additional help, please let us know here in the forums.

    Best regards,
    Jordan Shannon

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Blurry images in masonry gallery’ is closed to new replies.