Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8659863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:06:35+00:00 2026-06-12T16:06:35+00:00

I am using infinity load with jquery.window.scroll function with these codes. $(window).scroll(function(){ if ($(window).scrollTop()

  • 0

I am using infinity load with jquery.window.scroll function with these codes.

$(window).scroll(function(){
    if  ($(window).scrollTop() == $(document).height() - $(window).height()){
        var page = $('#lastPostsLoader').attr('page')*1;
        $('#lastPostsLoader').attr('page', page + 1);
        DataLoadFunction(page);
    }
});

But these codes requesting double time and sometimes false pages when scroll to bottom. Like this;

Scroll bottom—> loading page 1 and loading page 2—>scroll bottom—>loading page 3 and loading page 2—>scroll bottom—>loading page 4 an loading page 5 ……..

So where am i wrong? Thanks…

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T16:06:36+00:00Added an answer on June 12, 2026 at 4:06 pm

    you should prevent dataload till next data arrive. set variable isLoadingData as true while data is being loaded from server.

    var isLoadingData;
     $(window).scroll(function(){
            if  (($(window).scrollTop() == $(document).height() - $(window).height()) && !isLoadingData ){
                  isLoadingData = true; 
                var page = $('#lastPostsLoader').attr('page')*1;
                $('#lastPostsLoader').attr('page', page + 1);
                DataLoadFunction(page, function(){ //  callback get called after data load
                            isLoadingData  = false;
                });
            }
        });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using the infinite scroll plugin http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/ to load page content. I have
<script> $(window).load(function () { var $wall = $('#content'); $wall.imagesLoaded(function () { $wall.masonry({ itemSelector: '.oddpost',
I'm trying to add infinite scroll functionality to a page using code given in
I've been using JQuery masonry and now I'm adding infinite scroll. There are images
I'm using this JavaScript functions to create a JSP page with Infinite Scroll feature.
I'm incredibly new to JQuery and Javascript in general. I'm using the Infinite Scroll
I am using infinite scroll in conjunction with Jquery Masonry. Everything is working great,
I am using the infinite scroll plugin ( infinite-scroll ) with jQuery isotope and
I'm working on a Codeigniter application and in a page I'm using jQuery to
Hi I am trying to setup a site using jQuery Masonry and Infinite scroll

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.