Thursday, 27 September 2018

Reapplying jquery-match-height after isotope grid is filtered

I am using jquery-match-height to match the heights of an inner div inside the grid items of an isotope layout, and this is working perfectly when the isotope grid loads.

However when I filter the grid, the divs are no longer being processed by the matchheight script, every one of them returns to its original height.

I have tried:

  $grid.on( 'arrangeComplete', function() { 
   console.log("OK, arrangeComplete");
   $.fn.matchHeight._update();
   //$('.card-text').matchHeight(); //Here I tried simply re-initiating... no effect
  });

Also I tried:

if (!$grid.data('isotope').filteredItems.length ) {
 $.fn.matchHeight._update();
}

I simply cannot get matchheight to "refire"



from Reapplying jquery-match-height after isotope grid is filtered

No comments:

Post a Comment