0

画像の読み込み後に Isotope を実行するのに苦労しています。- ImagesLoaded プラグイン ( http://imagesloaded.desandro.com/ ) を Isotope に適用しようとしていますが、Images の読み込み後に Isotope を実行するのに苦労しています。

以下は、ImagesLoaded なしの私の同位体です。誰かがこれについてどうやって行くか知っていれば、私は最も感謝しています! (: これが私のアイソトープです: http://illuminategg.hol.es/portfolio.html

    var isotope_port = $('.port-isotope');
isotope_port.isotope({
    'itemSelector': '.item'
});

$('.port-filter a').click(function() {
    $(this).parent().parent().find('li').removeClass('selected');
    $(this).parent().addClass('selected');

    var selector = $(this).attr('data-filter');
    isotope_port.isotope({ filter: selector });
    return false;
});
4

1 に答える 1

0

imagesloadedの場合、アイソトープの一部ではないため、最初にスクリプトをページに追加します。次に、次のように使用します。

var isotope_port = $('.port-isotope'); isotope_port.imagesLoaded( function() { isotope_port.isotope({ 'itemSelector': '.item' }); });

于 2016-12-16T17:58:53.103 に答える