好的。我已经尝试过这种方式......并且它有效。
HTML
<div id="content">
<img src="images/1.gif" height="48" width="48" />
<img src="images/2.gif" height="48" width="48" />
<img src="images/3.gif" height="48" width="48" />
<img src="images/4.gif" height="48" width="48" />
...
</div>
JS
$(window).scroll(function() {
if($(window).scrollTop() )
if (($(window).scrollTop() + 100) >= $(document).height() - $(window).height()){
$.ajax({
url: 'images.txt',
success: function(data) {
$("#content").append('<img src="images/' + data + '" height="48" width="48" />');
}
});
}
});
It loads the pictures 100px before the bottom of the page. Also populates the data from ajax call. The call is from text file but this is irrelevant.