I am using this script for Load More in Magento 2 But it's not working
<script src ="https://infiniteajaxscroll.com/vendor/jquery-ias/dist/jquery-ias.min.js"></script>
<link src = "https://raw.githubusercontent.com/ravbetsky/infinite-ajax-scroll/master/dist/css/jquery.ias.css"/>
var ias = jQuery.ias({
container: ".test",
item: ".products-grid",
pagination: ".pages-items li",
next: ".item a"
});
ias.extension(new IASSpinnerExtension()); // shows a spinner (a.k.a. loader)
ias.extension(new IASTriggerExtension({offset: 3})); // shows a trigger after page 3
ias.extension(new IASNoneLeftExtension({
text: 'There are no more pages left to load.' // override text when no pages left
}));
if I go to second scroll, the add to cart button is not working properly.
Please give me some script for Load More Products.