Isotope Overlapping Images?

后端 未结 4 849
北荒
北荒 2021-02-04 07:17

It seems like it only happens in Chrome and Safari.. not Firefox. I\'m using it with the foundation responsive framework so I\'m not sure what to do about setting the height.

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-04 07:33

    imagesLoaded works by checking the images currently in the containing element. So in your case, it's not actually do anything in $(window).load() since there are no items in that element. Instead, I would recommend triggering imagesLoaded again, after items have been inserted with the $.ajax.success

    success: function(data){
        // Update isotope container with new data. 
        $container.isotope('remove', $container.data('isotope').$allAtoms )
        $container.isotope('insert', $(data) )
          // trigger isotope again after images have been loaded
          .imagesLoaded( function() {
            $container.isotope('reLayout');
          });
        }
    });
    

提交回复
热议问题