Closed Fanni-Portier closed 2 years ago
Asked to soon - sorry!
I found a solution by myself. Maybe another beginner will be looking for this task in the future. So this is how I did it.
var gridLength = $grid.length; var gridCompletet = 0;
$grid.on( 'layoutComplete', function() { gridCompletet++; if ( gridCompletet == gridLength ) { // do something gridCompletet = 0; console.log('all grids are ready'); } });
It seems i am unable to format code properly. There is still a lot to learn :D
Is there a way to do something as soon, as all masonry items on the page have triggered the "layoutComplete" event?