toddmotto / echo

Lazy-loading images with data-* attributes

Home Page:http://toddmotto.com/labs/echo

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can't retrieve image properly when use for infinite scrolling page

anggadarkprince opened this issue · comments

sometimes the images are loaded sometimes didn't,,,

// Assuming you load new content using an AJAX call
$.ajax({
  url: 'load-more-content.php',
  success: function(data) {
    // Append the new content to your container
    $('#content-container').append(data);

    // Initialize Echo.js for the new content
    echo.init({
      offset: 100, // Adjust this offset value as needed
      throttle: 250,
      unload: false,
    });
  },
});