jQuery isotope on first load doesn't work, How do I wait for all resources/images to be loaded?

后端 未结 7 1899
一个人的身影
一个人的身影 2021-01-17 16:57

I\'ve got something I\'ve put together using jQuery isotope here.. http://jsbin.com/eziqeq/6/edit

It seems to work in general but on first load, of a new tab, the Is

相关标签:
7条回答
  • 2021-01-17 17:40

    $('window').imagesLoaded( function() {

    // filter items on button click
    $('.portfolio-btn-group').on( 'click', 'button', function() {
      var filterValue = $(this).attr('data-filter');
      $grid.isotope({ filter: filterValue });
    });
    
    
    // init Isotope
    var $grid = $('.grid').isotope({
      itemSelector: '.grid-item',
      percentPosition: true,
      masonry: {
        // use element for option
        columnWidth: '.grid-item'
      }
    })
    });
    
    0 讨论(0)
提交回复
热议问题