私はacarabottからこの答えを見つけました - https://stackoverflow.com/a/13919010/735369
私はこれを実装しましたが、これはうまくいきました。唯一の問題は、スクロール アクションが発生するまで更新が行われないことです。
同位体のソート/フィルタリング機能を使用する場合は、lazyload の failure_limit を設定し、同位体の onLayout コールバックでイベントをトリガーする必要があります。
jQuery(document).ready(function($) {
var $win = $(window),
$con = $('#container'),
$imgs = $("img.lazy");
$con.isotope({
onLayout: function() {
$win.trigger("scroll");
}
});
$imgs.lazyload({
failure_limit: Math.max($imgs.length - 1, 0)
});
説明
ドキュメントによると ( http://www.appelsiini.net/projects/lazyload )
After scrolling page Lazy Load loops though unloaded images. In loop it checks if image has become visible. By default loop is stopped when first image below the fold (not visible) is found. This is based on following assumption. Order of images on page is same as order of images in HTML code. With some layouts assumption this might be wrong.
同位体の並べ替え/フィルター処理されたリストでは、ページの順序が HTML とは明らかに異なるため、failure_limit を調整する必要があります。
ご覧のとおり、jQuery オブジェクトを保存して、その長さ 1 を failure_limit として使用できるようにします。長さが 1 である理由に興味がある場合は、lazyload の update メソッドで次のチェックが行われているためです。
if (++counter > settings.failure_limit) {
return false;
}
他のイベントの遅延ロード
スクロールでレイジーロードをトリガーしない場合は、使用しているイベントの「スクロール」トリガーを交換する必要があります。デモ
http://jsfiddle.net/arthurc/ZnEhn/