Giter VIP home page Giter VIP logo

Comments (5)

nmn avatar nmn commented on September 26, 2024

I don't see a reason why you couldn't use a general infinite scroll solution in this case.

from salvattore.

rnmp avatar rnmp commented on September 26, 2024

The error is here:

salvattore['append_elements'](container, [newElements]);

It should be:

salvattore['append_elements'](container, newElements);

Let me know how it went.

from salvattore.

michaeltrilford avatar michaeltrilford commented on September 26, 2024

bump

from salvattore.

tomdowning82 avatar tomdowning82 commented on September 26, 2024

bump - any updates on this?

from salvattore.

benjibee avatar benjibee commented on September 26, 2024

The callback function of Infinite Scroll should reference the grid as a DOM element, not a jQuery object, and pass the new elements as such:

$('#grid').infinitescroll({
     appendCallback: false
  },
  function(newElements) {
    salvattore['append_elements'](document.getElementById('grid'), newElements);
});

Then update line :257 of salvattore.js:

  elements.forEach(function append_to_next_fragment(element) {

Which is attempting to loop over an object as an array, causing all sorts of problems, to the code below (which is used in the immediately following function anyway):

  Array.prototype.forEach.call(elements, function append_to_next_fragment(element) {

This works for me. I may have totally missed something obvious, and it may very well be that the actualy plugin code itself needs no updating, but this got it working for me. I'm going to create a pull request just incase this is actually the correct fix

👍

from salvattore.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.