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

  • SEARCH
  • Home
  • 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 9030341
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:27:58+00:00 2026-06-16T07:27:58+00:00

I have implemented the Infinitescroll plugin in an eCommerce Website, to scroll down all

  • 0

I have implemented the Infinitescroll plugin in an eCommerce Website, to scroll down all product pages in two different type of views: list & grid (.classes).

Everything Is working as expected except a little issue I’m having after loading a bunch of products, let’s say the following page, and changing the view type. In that point items keep loading but the “loading div” containing the image and the text fadesIn with null valors.

An example: We start with list type -> scroll down -> load next page -> scroll up -> change to grid type -> scroll down -> null apears.

Here’s some code:

//Calling infiniteScroll
$('.product-grid.box-product, .product-list').infinitescroll({
      navSelector  : "div .links",            
      nextSelector : "div .links a",    
      itemSelector : "div .struct",
              loading: {finishedMsg: "<em>endmsg</em>",
                        img: "url",
                        msgText: "<em>loading...</em>"}          
    },function(elm){
      //item display-mode sorting function
    });

//How are divs sorted up
function display(view) {
if (view == 'list') {
    $('.product-grid').attr('class', 'product-list');
    $('.product-list > div').each(function(index, element) {
        //item display-mode sorting function
    });
    $.cookie('display', 'list'); 
} else {
    $('.product-list').attr('class', 'product-grid box-product');
    $('.product-grid > div').each(function(index, element) {
        //item display-mode sorting function
    });
    $.cookie('display', 'grid');
}
}

I have been researching a lot, even looking trough the plugin core code and I just can’t seem to figure this out.

I’d like to thank you in advance for your help.

  • 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-16T07:28:00+00:00Added an answer on June 16, 2026 at 7:28 am

    I’ve kind of figured it out.

    The problem was the following:

    The products container div was chaning classes constantly so it kind of disoriented the plugin’s procedure. To solve this I’ve created a new div containing the chaning div:

    //Before Call
    $('.product-grid.box-product, .product-list').infinitescroll({
    
    //After Call
    $('#products').infinitescroll({
    

    Working with a different container makes the plugin load new products in the wrong div so in the callback i used this:

    $(elm).each(function(){
        if($.cookie('display') == 'grid'){
             $(this).appendTo('.product-grid');
        } else {
             $(this).appendTo('.product-list');
        }
    });
    

    After doing this in some cases products seemed to load with wrong display/css so I surfed trough the InfiniteScroll core code and inserted a function ( display() ) that changes the display/css of all products on the screen just after the ajax .load() function ends:

    //Plugin core code
    o.load(...,function(t){...;display(view);});
    //Plugin core code
    

    And that’s it! Plugin’s working very nice now!

    I hope this helps if any of you got a similar issue. Cheers!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Problem: I have implemented an infinitescroll plugin in my rails app, along with JQuery
I have a website on which I implement infinite scroll: when a user reaches
Have implemented a site in wordpress with 5 static pages besides the usual blog
I have implemented an eclipse plugin that it launches a java application when the
I have implemented the two classes shown at http://tomcat.apache.org/tomcat-6.0-doc/aio.html which gives a messenger application
I have implemented a slider bar type UI control, like the Unlock mechanism on
I have implemented a large list of views in a UIScrollView. I cannot use
I have implemented cloaking for search engines. In my category pages, it will display
We have implemented BlockUI (element blocking) for a large survey.. On most pages we
I have implemented the Datepicker though Jquery <html> <head> <script type=text/javascript src=js/jquery-1.7.1.min.js></script> <script type=text/javascript

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.