forked from ionic-team/ionic-framework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscroller.html
61 lines (57 loc) · 1.69 KB
/
scroller.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
<html>
<head>
<meta charset="utf-8">
<title>Scroll Horiz</title>
<!-- Sets initial viewport load and disables zooming -->
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
<link href="../dist/css/ionic.css" rel="stylesheet">
<style>
#filler {
border-top: 10px solid red;
border-bottom: 10px solid red;
}
.list-item {
padding: 10px;
}
#wrapper {
position: relative;
height: 100%;
overflow: hidden;
}
</style>
</head>
<body>
<section class="view-full">
<div class="bar bar-header bar-secondary">
<a href="#" class="button button-danger button-clear">Edit</a>
<h1 class="title">Scroll Me</h1>
<a href="#" class="button button-danger button-clear">Delete</a>
</div>
<div id="wrapper" style="margin-top: 44px">
<div id="scroller" class="scroll">
<div id="filler" style="width: 4400px; height: 6000px; background: url('tree_bark.png') repeat;"></div>
</div>
</div>
</section>
<script src="../dist/js/ionic.js"></script>
<script>
var s = document.getElementById('scroller');
var w = s.scrollHeight;
for(var i = 0; i < w; i++) {
if((i % 500) === 0) {
var l = document.createElement('span');
l.innerText = i + 'px'
l.style.position = 'absolute';
l.style.left = '20px';
l.style.top = i + 'px';
s.appendChild(l);
}
}
var scroll = new ionic.views.ScrollView({
el: s,
isHorizontalEnabled: false,
isVerticalEnabled: true
});
</script>
</body>
</html>