-1

my question is that i have a structure of website as

    <div class="span">.......</div>
    <div class="span">.......</div>
    <div class="span">.......</div>
    <div class="span">.......</div>
    <div class="span">.......</div>

these are 100+ loaded form database and working fine.I just want that initially it will show only 5 and then when user scroll down they will show more. thanks

Rj Adii
  • 36
  • 4

2 Answers2

0

You can refer to this link:

jQuery load first 3 elements, click "load more" to display next 5 elements

There is also an example.

Mikael Sauriol Saad
  • 112
  • 1
  • 2
  • 10
0
 <script>
$(document).ready(function () {
  size_li = $(".listingcall .span6").size();
  size_li = $(".listingcall .span6").size();
  x=3;
  $('.listingcall .span6:lt('+x+')').show();
  $(window).scroll(function() {
if($(window).scrollTop() == $(document).height() - $(window).height()) {
x= (x+5 <= size_li) ? x+5 : size_li;
$('.listingcall .span6:lt('+x+')').show();
      }    
 });
});
</script>
Rj Adii
  • 36
  • 4