Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
- <script src="//static.tumblr.com/yfztp0u/brUohnb4m/infinitescroll.js"></script>
- <script>
- $(document).ready(function(){
- $container = $('section#posts'); // change section#posts to your post container
- $container.infinitescroll({
- navSelector: 'div#pagination', // change div#pagination to your pagination wrapper
- nextSelector: 'a.next', // change a.next to your "next" link
- itemSelector: '.post', // change .post to your post tag/class
- loading: { // this is to remove the default loading text/image (i think?)
- img: '',
- msgText: '',
- },
- debug: true, // this'll log everything it's doing into the console; don't worry about it
- bufferPx: 0 // how far from the bottom of the page in px you have to scroll for it to load more posts
- }, function(items) {
- var $items = $(items);
- $items.addClass('new'); // adds 'new' class to the new posts
- // add any functions you have here (you'll need to call them again)
- // i.e. pxu photosets
- // makes sure the like button works
- $itemsIDs = $items.map(function(){
- return this.id;
- }).get();
- Tumblr.LikeButton.get_status_by_post_ids($itemsIDs);
- $items.removeClass('new'); // removes 'new' class after everything is done
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment