Answers for "load more scroll javascript"

1

ajax call to load a page on scrolling

$(document).ready(function(){
 
 $(window).scroll(function(){
 
  var position = $(window).scrollTop();
  var bottom = $(document).height() - $(window).height();

  if( position == bottom ){

   var row = Number($('#row').val());
   var allcount = Number($('#all').val());
   var rowperpage = 3;
   row = row + rowperpage;

   if(row <= allcount){
    $('#row').val(row);
    $.ajax({
     url: 'fetch_details.php',
     type: 'post',
     data: {row:row},
     success: function(response){
      $(".post:last").after(response).show().fadeIn("slow");
     }
    });
   }
  }

 });
 
});
Posted by: Guest on October-22-2020
0

load more javascript scroll

$(function(){
    $('#content').scrollPagination({
        'url': 'democontent.json',
        'data': {
            'page': 1,
            'size': 15,
        },
        'scroller': $(window),
        'autoload':false,
        'heightOffset': 0,
        'loading': "#loading",
        'loadingText': 'click to loading more.',
        'loadingNomoreText': 'No more.',
        'manuallyText': 'click to loading more.',
        'before': function(){
            $(this.loading).fadeIn();
        },
        'after': function(elementsLoaded){
            $(this.loading).fadeOut();
            $(elementsLoaded).fadeInWithDelay();
        }
    });
});
Posted by: Guest on August-10-2021
0

ajax call to load a page on scrolling

var position = $(window).scrollTop();
var bottom = $(document).height() - $(window).height();
Posted by: Guest on October-22-2020

Code answers related to "load more scroll javascript"

Code answers related to "Javascript"

Browse Popular Code Answers by Language