/
index.html
70 lines (65 loc) · 2.02 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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Content-Security-Policy" content="default-src * data:; style-src * 'unsafe-inline'; script-src * 'unsafe-inline' 'unsafe-eval'">
<link rel="stylesheet" href="https://cdn.rawgit.com/OnsenUI/OnsenUI-dist/2.0.0/css/onsenui.css" type="text/css" media="all" />
<link rel="stylesheet" href="https://cdn.rawgit.com/OnsenUI/OnsenUI-dist/2.0.0/css/onsen-css-components.css">
<script src="https://cdn.rawgit.com/OnsenUI/OnsenUI-dist/2.0.0/js/onsenui.js"></script>
<link rel="stylesheet" href="css/style.css">
<script>
window.fn = {};
window.fn.toggle = function(el) {
el.classList.toggle("active");
el.nextElementSibling.classList.toggle("show");
}
</script>
<style>
.accordion {
transition: 0.4s;
}
.accordion:before {
margin-top: -3px;
content: '\02795';
}
.accordion.active:before {
content: "\2796";
}
div.panel {
max-height: 0;
overflow: hidden;
transition: 0.6s ease-in-out;
opacity: 0;
}
div.panel.show {
opacity: 1;
max-height: 500px;
}
.list__item__center {
padding-left: 5px;
}
</style>
</head>
<body>
<ons-page>
<ons-toolbar>
<div class="center">
Accordion + List and Onsen
</div>
</ons-toolbar>
<ons-list>
<ons-list-item>
Home
</ons-list-item>
<ons-list-item tappable class="accordion" onclick="fn.toggle(this)">Items</ons-list-item>
<div class="panel">
<ons-list-item tappable>Item 1</ons-list-item>
<ons-list-item tappable>Item 2</ons-list-item>
<ons-list-item tappable>Item 3</ons-list-item>
<ons-list-item tappable>Item 4</ons-list-item>
</div>
</ons-list>
</ons-page>
</body>
</html>