次のように、ページの下部に到達すると、より多くのコンテンツを自動的にロードする Web アプリケーションがあります。
$window
.on('scroll', function () {
var
$this = $(this)
;
if ($this.scrollTop() == $document.height() - $window.height()
&& $('#product-list').hasClass('has-more')) {
// load more content
}
})
現在、利用可能なコンテンツがなくなったときに削除される親要素で「has-more」クラスを使用しています。
私はこのアプローチに満足していません。