-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdemo.html
More file actions
92 lines (82 loc) · 1.93 KB
/
demo.html
File metadata and controls
92 lines (82 loc) · 1.93 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width,user-scalable=no">
<title>下拉刷新</title>
<style>
*{margin:0;padding:0;}
body {
padding-top: 100px;
background: #f80;
font-size: 12px;
}
#wrapper {
height: 500px;
overflow-y: scroll;
border: 1px solid #f00;
background: #dbdada;
}
#wrapper .container {
margin-top: -50px;
background: #f80;
height: 2000px;
}
.refreshBar {
/*margin-top: -50px;*/
/*-webkit-transform: translateY(-50px);*/
height: 50px;
background: #ccc;
text-align: center;
line-height: 50px;
}
.transition {
-webkit-atransition: transform .5s;
transition: transform .5s;
}
</style>
</head>
<body>
<div id="wrapper">
<div id="container" class="container">
<!-- <div class="refreshStatus">下拉刷新</div> -->
1 <br>1 <br>1 <br>1 <br>1 <br>1 <br>1 <br>1 <br>1 <br>
</div>
</div>
<script src="zepto.js"></script>
<script src="pullRefresh.js"></script>
<script>
// var $wrapper = $("#wrapper"),
// $container = $("#container");
// var startY = 0,
// refreshY;
// $wrapper.on("touchstart", function(e) {
// console.log(e);
// startY = e.touches[0].clientY;
// });
// $wrapper.on("touchmove", function(e) {
// if (e.changedTouches[0].clientY > startY) {
// touchUp(e.changedTouches[0].clientY);
// }
// });
// $container.on("webkitTransitionEnd", function() {
// console.log(2)
// $container.removeClass("transition");
// });
// $wrapper.on("touchend", function(e) {
// console.log(e);
// $container.addClass("transition").css("transform", "translateY(0px)");
// refreshY = 0;
// });
// function touchUp(clientY) {
// if ($wrapper.scrollTop() === 0 && !refreshY) {
// refreshY = clientY;
// }
// if (refreshY) {
// var moveY = clientY - refreshY;
// $container.css("transform", 'translateY(' + moveY/2 + 'px)');
// }
// }
</script>
</body>
</html>