Skip to content

Commit e0a086c

Browse files
committed
Fix infinite scroll
1 parent 6894a33 commit e0a086c

3 files changed

Lines changed: 14 additions & 2 deletions

File tree

_layouts/posts.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,6 @@
1515
{% include carousel-scripts.html %}
1616

1717
<script src="/js/application.js"></script>
18+
<script src="/js/infinite-jekyll.js"></script>
1819
</body>
1920
</html>

index.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
<section class="blog">
66
<section class="posts">
7-
{% for post in site.posts limit: 10 %}
7+
{% for post in site.posts limit: 5 %}
88
<article class="post">
99
<a href="{{ post.url }}">
1010
<h1 class="name">
@@ -19,4 +19,6 @@ <h1 class="name">
1919
</article>
2020
{% endfor %}
2121
</section>
22+
23+
<div class="infinite-spinner"></div>
2224
</section>

js/application.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,17 @@
1-
$(document).ready(function() {
1+
$.ajaxSetup({
2+
global: true,
3+
});
4+
5+
function resizePostVideoPlayers() {
26
$(".post iframe").
37
attr("width", 775).
48
attr("height", 432);
9+
}
510

11+
$(document).ready(resizePostVideoPlayers);
12+
$(document).ajaxComplete(resizePostVideoPlayers);
13+
14+
$(document).ready(function() {
615
if ($.fn.jcarousel) {
716
$("[data-behavior*=carousel]").jcarousel({
817
wrap: "circular",

0 commit comments

Comments
 (0)