-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.html
74 lines (73 loc) · 1.87 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1,width=device-width, height=device-height"/>
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<style>
body {
padding: 0px;
margin: 0px;
}
.scrollable {
-webkit-overflow-scrolling: touch;
position: absolute;
top: 60px;
bottom: 0px;
height: auto;
width: 100%;
background-color: red;
overflow-y: auto;
}
header {
line-height: 60px;
font-size: 24px;
text-align: center;
background-color: #eee;
position: fixed;
width: 100%;
z-index: 100;
}
.content {
}
</style>
</head>
<body>
<header>
header
</header>
<div class="scrollable">
<div class="content">
scroll me
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
<div class="tmp">1111111111</div>
</div>
</div>
<script src='build/build.js'></script>
<script>
var fix = require('scrollfix');
var el = document.querySelector('.scrollable');
fix(el);
el.addEventListener('touchend', function(e) {
console.log(el.scrollTop);
});
el.addEventListener('scroll', function(e) {
console.log(el.scrollTop);
});
document.querySelector('header').addEventListener('click', function() {
el.parentNode.removeChild(el);
}, false);
</script>
</body>
</html>