Tagged: blurry images, Masonry Gallery
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!
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
Hi Mike,
That appears to have worked! Thank you.
Natalie
Hi,
I’m glad this was resolved. If you need additional help, please let us know here in the forums.
Best regards,
Jordan Shannon