lazysizes + matchHeight

Created on 6 Mar 2017  路  1Comment  路  Source: aFarkas/lazysizes

Hello!

I know that someone posted a question about lazysizes+masonry (https://github.com/aFarkas/lazysizes/issues/83) but I'm using matchHeight (https://github.com/liabru/jquery-match-height) on my project.

How do i fire up $.fn.matchHeight._update() after the image has been lazyloaded?

Most helpful comment

Hello!

I used the code snippet you gave and removed function for masonry.

$('.grid').each(function(){
    var $masonry = $(this);
    var update = function(){
        $.fn.matchHeight._update();
    };
    $('.grid-item', $masonry).matchHeight();
    this.addEventListener('load', update, true);
});

It is now working! Thanks!

>All comments

Hello!

I used the code snippet you gave and removed function for masonry.

$('.grid').each(function(){
    var $masonry = $(this);
    var update = function(){
        $.fn.matchHeight._update();
    };
    $('.grid-item', $masonry).matchHeight();
    this.addEventListener('load', update, true);
});

It is now working! Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dhymik picture dhymik  路  5Comments

Legic picture Legic  路  4Comments

Undistraction picture Undistraction  路  5Comments

virginiarcruz picture virginiarcruz  路  3Comments

thasmo picture thasmo  路  6Comments