0

我正在努力让我的同位素在图像加载后执行,因为否则,同位素项目会重叠。- 我正在尝试将 ImagesLoaded 插件 ( http://imagesloaded.desandro.com/ ) 应用于我的同位素,但是,在图像加载后我正在努力执行同位素。

下面是我没有加载图像的同位素,如果有人知道如何去做,我将不胜感激!(:这是我的同位素在行动: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 回答