jquery delegate elements in infinite scroll
I’m using this “simple” code to assign a pin id to the container divs and click to open the .pin-card content. This works fine, but when I add the infinite scroll script, this code does not work for new elements that are loaded. $(document).on(“click”, “.showImage”, function() { $(‘.pin-card’).not(‘#pin’ + $(this).attr(‘target’)).hide(); $(‘#pin’ + $(this).attr(‘target’)).toggle(); }); Only … Read more