-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
141 lines (134 loc) · 5.11 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="X-UA-Compatible" content="ie=edge" />
<title>Easy Accordion Demo</title>
<link
href="https://fonts.googleapis.com/css?family=Open+Sans:400,500,700|Kaushan+Script&display=swap"
rel="stylesheet"
/>
<link rel="stylesheet" href="demo.css" />
</head>
<body>
<div class="main-wrapper">
<div class="heading-wrap">
<h1 class="heading">Easy Accordion</h1>
<h4 class="sub-title">A Pure JS Accordion</h4>
</div>
<ul class="menu-wrap">
<li><a href="#setup">Setup</a></li>
<li><a href="#usage">Usage</a></li>
<li><a href="#usage">Options</a></li>
<li><a href="#examples">Examples</a></li>
</ul>
<div id="setup" class="setup block-wrap">
<div class="container">
<h2 class="block-heading">Setup</h2>
<div class="desc">
So, to start using the <span>Easy Accordion</span> plugin in your
project, you can include the script in your head/body section as
shown below.
</div>
<code>
<script src="https://cdn.jsdelivr.net/gh/farhanhalai30/easy-accordion/js/easy-accordion.min.js"></script>
</code>
</div>
</div>
<div id="usage" class="usage block-wrap">
<div class="container">
<h2 class="block-heading">Usage</h2>
<div class="desc">
Once you have included the script in your code, you can start using
Easy Accordion as shown in the code below. For more list of options
<a href="#options">refer here</a>
</div>
<code>
<script> <br />
var e_acc_obj = new EasyAccordion({ <br />
target: "my-accordion",<br />
transitionDuration: 0.3,<br />
blockClass: "block",<br />
triggerClass: "title",<br />
contentClass: "content",<br />
triggerActiveClass: "active-title",<br />
contentActiveClass: "active-content"<br />
});<br />
</script>
</code>
</div>
</div>
<div id="options" class="options block-wrap">
<div class="container">
<h2 class="block-heading">Options</h2>
<table class="options-table">
<tr>
<th>Option</th>
<th>Description</th>
<th>Type</th>
<th>Optional/Mandatory</th>
</tr>
<tr>
<td>target</td>
<td>Selector name of the target element.</td>
<td>String</td>
<td>Mandatory</td>
</tr>
<tr>
<td>blockClass</td>
<td>Class name for the block element</td>
<td>String</td>
<td>Mandatory</td>
</tr>
<tr>
<td>triggerClass</td>
<td>Class name for the trigger element (the one which is clickable).</td>
<td>String</td>
<td>Mandatory</td>
</tr>
<tr>
<td>contentClass</td>
<td>Class name for the content.</td>
<td>String</td>
<td>Mandatory</td>
</tr>
<tr>
<td>transitionDuration</td>
<td>Amount of time to transite (in seconds).</td>
<td>Number</td>
<td>Optional</td>
</tr>
<tr>
<td>triggerActiveClass</td>
<td>Class name for the trigger element in the active state (active means accordion is open).</td>
<td>String</td>
<td>Optional</td>
</tr>
<tr>
<td>contentActiveClass</td>
<td>Class name for the trigger element in the active state.</td>
<td>String</td>
<td>Optional</td>
</tr>
</table>
</div>
</div>
<div id="examples" class="examples block-wrap">
<div class="container">
<h2 class="block-heading">Examples</h2>
<ul class="examples-list">
<li>
<h3>Example #1: Basic</h3>
<div>A basic demo of using <b>Easy Accordion</b> for the first time. <a href="https://farhanhalai30.github.io/easy-accordion/examples/basic-example">Click here</a> check out in action</div>
</li>
<li>
<h3>Example #2: Custom Active Classes</h3>
<div>Using custom active classes for trigger & content elements. Classes get added when the accordion is in active state. <a href="https://farhanhalai30.github.io/easy-accordion/examples/custom-active-classes">Click here</a> check out in action</div>
</li>
</ul>
</div>
</div>
</div>
</body>
</html>