Infinite scroll in Drupal7 (no module)
Good day, my friends! Sorry for the english Faced with the problem of ...
I do not really speak JS. Making a website for Drupal7. Views use with
Infinite scroll and Masonry. When you scroll down the page does not define
"page?=1" and shows that there is no posts and page is no load :(
Here is the code page:
<div id="container" class="page-container">
<div class="poster-item">content...</div>
<div class="poster-item">content...</div>
<div class="poster-item">content...</div>
<div class="poster-item">content...</div>
<div class="item-list">
<ul class="pager">
<li class="pager-previous first"> </li>
<li class="pager-current">1 èç 2</li>
<li class="pager-next last"><a href="node?page=1">next</a></li>
</ul>
</div> </div>
This code JS:
$(function (){
var $container = $('#container');
//create masonry
$container.imagesLoaded(function(){
$container.masonry({
itemSelector: '.poster-item',
columnWidth: 3
});
});
//create infinitescroll
$container.infinitescroll({
navSelector : '.pager', // selector for the paged
navigation
nextSelector : '.pager-next a', // selector for the NEXT
link (to page 2)
itemSelector : '.poster-item', // selector for all items
you'll retrieve
loading: {
finishedMsg: 'Áîëüøå íîâîñòåé íåò :(',
img: '/images/loading.gif'
}
},
// Masonry callback
function( newElements ) {
var $newElems = $( newElements ).css({ opacity: 0 });
$newElems.imagesLoaded(function(){
$newElems.animate({ opacity: 1 });
$container.masonry( 'appended', $newElems, true );
});
}
);
});
No comments:
Post a Comment