Created
August 6, 2020 11:14
-
-
Save isabellachen/ab38b43a5bd9a619aa3f0db615c8b5a5 to your computer and use it in GitHub Desktop.
Get masonry.js to rebuild with jetpack turned on
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
$(document.body).on('jetpack-lazy-loaded-image', function() { | |
var $container = $('.blog-masonry'); | |
$container.imagesLoaded(function() { | |
$container.masonry('reloadItems').masonry('layout'); | |
}); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment