I’m using the jquery isotope plugin (and infinite scrolling) + fitvids.js in a layout. I got it working for the most part but the problem is with the videos contained in the pages loaded with infinite scrolling.
Vids #1 and #2 in the first page are being resized
Vid #3 in the second page loaded with the infinite scroll plugin is being ignored
My code:
$(document).ready(function() {
// start fitvids.js
$(".video").fitVids();
// start isotope
var $container = $('#wrapper');
$container.isotope({
itemSelector : '.post'
});
$container.infinitescroll({
navSelector : '#page-nav', // selector for the paged navigation
nextSelector : '#page-nav a', // selector for the NEXT link (to page 2)
itemSelector : '.post', // selector for all items you'll retrieve
loading: {
finishedMsg: 'No more pages to load.',
img: 'http://i.imgur.com/qkKy8.gif'
}
},
// call Isotope as a callback
function(newElements){
var $newElems = $(newElements);
$newElems.imagesLoaded(function(){
$('#wrapper').isotope( 'appended', $newElems );
});
}
);
});
You were right steveax, thanks. Here’s the new code