I'm attempting to create a tumblr theme and I'm using the masonry and infinite scroll plugins for jquery. the masonry is working just fine. however, i cannot get the infinite scroll to work at all. here's my jQuery code:
<script type="text/javascript" src="../jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="../masonry.js"></script>
<script type="text/javascript" src="../jquery.infinitescroll.js"></script>
<script type="text/javascript">
$('document').ready(function(){
$('#content').imagesLoaded(function(){
$('#content').masonry({
itemSelector: '.post',
columnWidth: 260});
});
$('#content').infinitescroll({
navSelector : '#nav',
nextSelector : '#nav a',
itemSelector : '#content div.post',
},
function( newElements ) {
var $newElems = $( newElements );
$('#content').masonry( 'appended', $newElems, function(){$newElems.fadeIn('slow');} );
});
});
</script>
and this is my HTML:
<div id="content">
{block:Posts}
{block:Photo}
<div class="post">
<img src="{PhotoURL-250}" width="250" />
</div>
{/block:Photo}
{/block:Posts}
{block:Pagination}
<div id="nav">{block:NextPage}<a href="{NextPage}"></a>{/block:NextPage}</div>
{/block:Pagination}
Any help is greatly appreciated. thanks in advance.
*I would also like to note that the i shortened the URLs to the js files on purpose just to make the post look better, on my actual theme the URLs are correct.
This is what the console displayed after i added a debug (To be honest i don't really know what it means but hopefully it helps)
Testing console
["determinePath",
Array[2]
0: "/page/"
1: ""
length: 2
__proto__: Array[0]
] jquery.infinitescroll.js:171
["Binding", "bind"] jquery.infinitescroll.js:171
["math:", 77, 644] jquery.infinitescroll.js:171
["heading into ajax",
Array[2]
0: "/page/"
1: ""
length: 2
__proto__: Array[0]
] jquery.infinitescroll.js:171
["Using HTML via .load() method"] jquery.infinitescroll.js:171
["contentSelector",
<div id="content" style="position: relative; height: 689px; " class="masonry">…</div>
] jquery.infinitescroll.js:171
["math:", 292, 644] jquery.infinitescroll.js:171
["heading into ajax",
Array[2]
] jquery.infinitescroll.js:171
["Using HTML via .load() method"] jquery.infinitescroll.js:171
["Error", "end"] jquery.infinitescroll.js:171
["Binding", "unbind"]