-
Notifications
You must be signed in to change notification settings - Fork 22
Expand file tree
/
Copy pathwindow.html
More file actions
42 lines (37 loc) · 1.33 KB
/
window.html
File metadata and controls
42 lines (37 loc) · 1.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<!DOCTYPE html>
<html>
<head>
<title>Simulate delay when callback returned,like it can be when asynchronous ajax request called from
callback</title>
<script type="text/javascript" src="../libs/jquery/jquery.js"></script>
<script type="text/javascript" src="../src/jquery-paged-scroll.js"></script>
</head>
<body>
<h1>Scroll to the bottom to see pages are loaded</h1>
<div id="largeData"></div>
<script type="text/javascript">
$(document).ready(function (e) {
for (var i = 0; i < 50; i++) {
$('#largeData').append("<div>Test</div><br>");
}
});
$(window).paged_scroll({
handleScroll:function (page,container,doneCallback) {
setTimeout(function () {
console.log("Page is:", page);
$('#largeData').append("Appending data for page:" + page + "<div>DATA DATA DATA</div><br><div>DATA</div><br><div>DATA</div><br><div>DATA DATA DATA</div><br><div>DATA</div><br><div>DATA</div><br>");
// doneCallback();
}, 1000);
return true;
},
// Uncomment to enable infinite scroll
//pagesToScroll : 5,
triggerFromBottom:'5%',
loader:'<div class="loader"></div>',
pagesToScroll:120,
targetElement:$('#largeData'),
debug:true
});
</script>
</body>
</html>