Overlapping posts using infinite scroll + masonry

Overlapping posts using infinite scroll + masonry

I have installed the theme "Issue" on my tumblr blog, but infinite scroll + masonry is overlapping all the posts. I've read some threads about it, but nothing seems to work. This is the code:

  1. $(function() { $( '#posts' ).masonry({ itemSelector: '.post', columnWidth: 1 }).imagesLoaded(function() { $( this ).masonry( 'reloadItems' ); }); if( Issue.index_page ) { if( Issue.infinite_scroll ) $( '#posts' ).infinitescroll({ navSelector: '#pagination', nextSelector: '#pagination #next', itemSelector: '.post', loading: { img: 'http://i.imgur.com/6RMhx.gif', msgText: '', donetext: '' } }, function( newElements ) { $( '#posts' ).masonry( 'appended', $( newElements ), true ).imagesLoaded(function() { $( this ).masonry( 'reloadItems' ); }); preparePosts( newElements ); }); } preparePosts( '.post' );

This is the full source code:  http://pastebin.com/kEQKFgXj

Any help would be much appreciated!