解决方法
试试吧:
HTML:
<div id="postswrapper"> <div class="item">content</div> ... <div id="loadmoreajaxloader" style="display:none;"><center><img src="ajax-loader.gif" /></center></div> </div>
使用Javascript:
<script type="text/javascript"> $(window).scroll(function() { if($(window).scrollTop() == $(document).height() - $(window).height()) { $('div#loadmoreajaxloader').show(); $.ajax({ url: "loadmore.PHP",success: function(html) { if(html) { $("#postswrapper").append(html); $('div#loadmoreajaxloader').hide(); }else { $('div#loadmoreajaxloader').html('<center>No more posts to show.</center>'); } } }); } }); </script>