Closed plusPlus91 closed 5 years ago
Currently, in the done
method, you are triggering imagesLoaded
on $grid
, but you could trigger it just on the $content
$content.imagesLoaded( function() {
posts_cn.append( $content ).masonry( 'appended', $content );
scrolled = 0;
});
Otherwise, this looks okay. If it takes longer than you would prefer, that's just how long it takes for images to be loaded.
Hello,
I have a performance problem with imagesloaded. I've created a sandbox with this code:
Everything is working fine and with a lot of speed. Then I tried to insert this code into an existing script. The script code was BEFORE I added Masonry:
And changed it to:
Everything is working but the loading time is not good, 2-5 seconds. If I delete the $grid.imagesLoaded and only use the "posts_cn.append( $content ).masonry( 'appended', $content );" than the speed is great but the masonry overlaps the divs.
Do you have any idea?