-
Notifications
You must be signed in to change notification settings - Fork 417
/
native.html
76 lines (65 loc) · 1.66 KB
/
native.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
75
76
<!DOCTYPE HTML>
<html>
<head>
<title>Scroll Demo - Native</title>
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-touch-fullscreen" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0;"/>
<style type="text/css">
body{
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 14px;
line-height: 1.8;
}
#container{
position: absolute;
left: 20px;
top: 20px;
bottom: 20px;
right: 20px;
border: 5px solid black;
-webkit-user-select: none;
-moz-user-select: none;
overflow: scroll;
-webkit-overflow-scrolling: touch;
}
#content{
background: white;
width: 2000px;
height: 2000px;
}
.cell{
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
width: 100px;
height: 100px;
display: inline-block;
text-indent: 6px;
}
</style>
</head>
<body>
<div id="container">
<div id="content">
</div>
</div>
<script type="text/javascript">
var container = document.getElementById("container");
var content = document.getElementById("content");
// Content Generator
var size = 100;
var frag = document.createDocumentFragment();
for (var row=0, rl=content.clientHeight/size; row<rl; row++) {
for (var cell=0, cl=content.clientWidth/size; cell<cl; cell++) {
elem = document.createElement("div");
elem.className = "cell";
elem.style.backgroundColor = row%2 + cell%2 > 0 ? "#ddd" : "";
elem.innerHTML = row+","+cell;
frag.appendChild(elem);
}
}
content.appendChild(frag);
</script>
</body>
</html>