Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/omgimalexis/infinitescroll
Tumblr Infinite Scroll
https://github.com/omgimalexis/infinitescroll
Last synced: 29 days ago
JSON representation
Tumblr Infinite Scroll
- Host: GitHub
- URL: https://github.com/omgimalexis/infinitescroll
- Owner: OmgImAlexis
- Created: 2014-03-28T03:08:01.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-17T02:13:36.000Z (over 10 years ago)
- Last Synced: 2024-10-14T07:53:48.448Z (about 1 month ago)
- Language: JavaScript
- Size: 195 KB
- Stars: 3
- Watchers: 4
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Tumblr Infinite Scroll
==============
Add this to your theme before head> and then replace .post with your post class/ID and #posts with your post wrapper class/ID.
```$(document).ready(function() {
//http://www.shambix.com/en/isotope-twitter-bootstrap-infinite-scroll-fluid-responsive-layout/
var $container = $('#posts');
// Fire Isotope only when images are loaded
$container.imagesLoaded(function(){
$container.isotope({
itemSelector : '.post',
masonry: {
}
});
});// Infinite Scroll
$('#posts').infinitescroll({
navSelector : '#pagination',
nextSelector : '#pagination a',
itemSelector : '.post',
bufferPx : 200,
loading: {
finishedMsg: 'We\'re done here.',
}
},// Infinite Scroll Callback
function( newElements ) {
var $newElems = jQuery( newElements ).hide();
$newElems.imagesLoaded(function(){
$newElems.fadeIn();
$container.isotope( 'appended', $newElems );
});
});if ($('.post:last').position().top > 200) {
$('#posts').infinitescroll('retrieve');
}
});```