Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
kapantzak committed Jul 30, 2015
1 parent 12fc5ac commit 376d6e4
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,11 @@ For more information about the structure of the tiles page, visit [jsTiles](http

##Ajax load##

You also have the ability to load more articles when the user scrolls down to the last line of tiles. At this time, the template just shows up the alreaady loaded posts (doesn't perform any ajax call).
You also have the ability to load more articles when the user scrolls down to the last line of tiles. At this time, the template just shows up the already loaded posts (doesn't perform any ajax call).

You can find the `loadOnScroll()` function inside `scripts/scripts.js` file to see hoe the template loads the next post on scroll. Feel free to change this feature in order to perform an ajax call to load the next set of posts.
You can find the `loadOnScroll()` function inside `scripts/scripts.js` file to see how the template loads the next post on scroll. Feel free to change this feature in order to perform an ajax call to load the next set of posts.

A small example:
Just change the part of code inside the first `if` statement, and perform an ajax call in order to load the next set of tiles:

var loadOnScroll = function() {
var win = $(window);
Expand All @@ -60,11 +60,16 @@ A small example:
var contentBottom = cont.offset().top - parseFloat(win.scrollTop()) + contH;
if (contentBottom < lim) {
topPos('absolute');
cont
.find('.view-more-section.hidden')
.first()
.removeClass('hidden')
.jstiles(opt);

// Place here the ajax call
$.get('yourPage.php', function(data) {
if (data && data != '') {
//Build the tiles structure and initialize jsTiles()
} else {
alert('No more posts!');
}
});

} else {
topPos('fixed');
}
Expand Down
1 change: 1 addition & 0 deletions post.html
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ <h3>Dependencies</h3>
<li><a href="http://getbootstrap.com/" target="_blank">Bootstrap</a></li>
<li><a href="http://kapantzak.github.io/jstiles/" target="_blank">jsTiles</a></li>
</ul>
<p>For more information check the README file on <a href="https://github.com/kapantzak/BlogTiles" target="_blank">GitHub</a></p>
</div>
</div>

Expand Down

0 comments on commit 376d6e4

Please sign in to comment.