waypoints icon indicating copy to clipboard operation
waypoints copied to clipboard

Infinite Scroll | Add Fade in effect

Open ghost opened this issue 7 years ago • 1 comments

I want to add a fade in effect to only to the recently added content. How do I achieve this? I want to prevent any abrupt transition between existing and new content.

$('.infinite-item').fadeOut();

var infinite = new Waypoint.Infinite({
  element: $('.infinite-container')[0],
  onBeforePageLoad: function() {
    $('.infinite-item').fadeIn();
  }
})

ghost avatar Jun 20 '17 14:06 ghost

var infinite = new Waypoint.Infinite({
  element: $('.infinite-container')[0],
  onAfterPageLoad: function ($items) {
    $items.each(function () {
      // you can edit '.infinite-item' by this
      $(this).addClass('loaded');
    });
  }
})

solhuang2201 avatar Jun 14 '22 18:06 solhuang2201