Infinite Scroll with turbo-rails and vanilla js do not refresh data-fslightbox to add more images to gallery

50 views Asked by At

I am using turbo-rails to implement post's infinite scroll. This posts have images and I use vanilla js to provider a good visualization of images as showed bellow:

<%= link_to file, 'data-fslightbox': "gallery" do %>
  <%= image_tag file, class: 'img-fluid', loading: 'lazy' %>
<% end %>

The gallery works well at the "first page", but the next pages, the "gallery" does not work.

Anyone may help me about it?

0

There are 0 answers