muh
This commit is contained in:
parent
852af35e46
commit
da08de7b79
12
s/test.js
12
s/test.js
|
@ -1,6 +1,6 @@
|
||||||
$(document).ready(function() {
|
var scrollListener = function () {
|
||||||
$(window).scroll(function() {
|
$(window).one("scroll", function () {
|
||||||
if($(window).scrollTop() == $(document).height() - $(window).height()) {
|
if($(window).scrollTop() + 256 >= $(document).height() - $(window).height()) {
|
||||||
$.ajax({
|
$.ajax({
|
||||||
url: './api/p/'+$('#posts').data('last'),
|
url: './api/p/'+$('#posts').data('last'),
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
|
@ -8,11 +8,15 @@ $(document).ready(function() {
|
||||||
var html = "";
|
var html = "";
|
||||||
for(var i = 0; i < msg.items.length; i++)
|
for(var i = 0; i < msg.items.length; i++)
|
||||||
if(msg.items[i].id)
|
if(msg.items[i].id)
|
||||||
html += "<a href=\"./"+msg.items[i].id+"\" title=\""+msg.items[i].mime+"\"><img class=\"thumb\" src=\"./t/"+msg.items[i].id+".png\" /></a>\n";
|
html += "<a href=\"./"+msg.items[i].id+"\" title=\""+msg.items[i].mime+"\"><img class=\"thumb\" src=\"//f0ck.me/t/"+msg.items[i].id+".png\" /></a>\n";
|
||||||
$('#posts').append(html);
|
$('#posts').append(html);
|
||||||
$('#posts').data('last', msg.last);
|
$('#posts').data('last', msg.last);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
setTimeout(scrollListener, 50);
|
||||||
});
|
});
|
||||||
|
};
|
||||||
|
$(document).ready(function () {
|
||||||
|
scrollListener();
|
||||||
});
|
});
|
|
@ -9,7 +9,7 @@
|
||||||
<div class="body">
|
<div class="body">
|
||||||
<div id="posts" data-last="{{ last }}">
|
<div id="posts" data-last="{{ last }}">
|
||||||
{% for item in items %}
|
{% for item in items %}
|
||||||
<a href="./{{ item.id }}" title="{{ item.mime }}"><img class="thumb" src="./t/{{ item.id }}.png" /></a>
|
<a href="./{{ item.id }}" title="{{ item.mime }}"><img class="thumb" src="//f0ck.me/t/{{ item.id }}.png" /></a>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
<div class="clear"></div>
|
<div class="clear"></div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user