Filter & sort magical layouts http://isotope.metafizzy.co
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

55 lines
1.7 KiB

---
title: Infinite Scroll
layout: demo
category: demos
related: layout
infinite_scroll: true
---
<section id="copy">
<p>Isotope is interoperable with <a href="http://www.infinite-scroll.com/">Infinite Scroll</a> by Paul Irish. Use the <a href="../docs/methods.html#appended"><code>appended</code></a> method to add new items to the Isotope layout.</p>
</section>
<div id="container" class="variable-sizes clearfix infinite-scrolling">
{% for element in site.elements_ordered limit:20 %}
{% include element-partial.html %}
{% endfor %}
</div> <!-- #container -->
<nav id="page_nav">
<a href="../pages/2.html"></a>
</nav>
<script src="../js/jquery-1.4.4.min.js"></script>
<script src="../jquery.isotope.js"></script>
<script src="../js/jquery.infinitescroll.min.js"></script>
<script>
$(function(){
var $container = $('#container');
$container.isotope({
itemSelector : '.element',
});
$container.infinitescroll({
navSelector : '#page_nav', // selector for the paged navigation
nextSelector : '#page_nav a', // selector for the NEXT link (to page 2)
itemSelector : '.element', // selector for all items you'll retrieve
donetext : 'No more pages to load.',
loadingImg : 'http://i.imgur.com/qkKy8.gif',
debug: false,
errorCallback: function() {
// fade out the error message after 2 seconds
$('#infscr-loading').animate({opacity: .8},2000).fadeOut('normal');
}
},
// call Isotope as a callback
function( newElements ) {
$container.isotope( 'appended', $( newElements ) );
}
);
});
</script>