I am loading some content with infinite scroll. I would like to change the border on every .post
that was loaded. I've got a function in the callback, like so:
$('#index-container').infinitescroll({
loading: {
finishedMsg: " ",
img: "http://i.imgur.com/6SXXf7L.gif",
},
behavior: undefined,
binder: $(window), // used to cache the selector for the element that will be scrolling
nextSelector: "#next-page",
navSelector: "#footer",
itemSelector: ".post",
dataType: 'html',
}, function() {
$('.post').css('border', '5px solid red'); // my function
});
However, once this has called, it affects everything (even content not loaded by infinite scroll). Is there a way I can only target newly loaded content?