forked from apeatling/web-pull-to-refresh
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
55 lines (44 loc) · 1.52 KB
/
index.html
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
43
44
45
46
47
48
49
50
51
52
53
54
55
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Web Pull To Refresh 1.1</title>
<meta name="viewport" content="user-scalable=no, width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="lib/genericons/genericons.css">
<link rel="stylesheet" href="base.css">
</head>
<body>
<div id="ptr">
<span class="genericon genericon-next"></span>
<div class="loading">
<span id="l1"></span>
<span id="l2"></span>
<span id="l3"></span>
</div>
</div>
<div id="content">
Pull down to refresh!
</div>
<script src="lib/hammer.2.0.4.js"></script>
<script src="lib/wptr.1.1.js"></script>
<script>
window.onload = function() {
WebPullToRefresh.init( {
loadingFunction: exampleLoadingFunction
} );
};
// Just an example loading function that returns a
// promise that WebPullToRefresh can use.
var exampleLoadingFunction = function() {
return new Promise( function( resolve, reject ) {
// Run some async loading code here
if ( true /* if the loading worked */ ) {
resolve();
} else {
reject();
}
} );
};
</script>
</body>
</html>