forked from samsono/Easy-Responsive-Tabs-to-Accordion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.html
160 lines (152 loc) · 7.49 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<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,chrome=1" />
<title>Easy Responsive Tabs to Accordion</title>
<link type="text/css" rel="stylesheet" href="css/easy-responsive-tabs.css" />
<script src="js/jquery-1.6.3.min.js"></script>
<script src="js/easyResponsiveTabs.js" type="text/javascript"></script>
<style type="text/css">
.demo {
width: 980px;
margin: 0px auto;
}
.demo h1 {
margin:33px 0 25px;
}
.demo h3 {
margin: 10px 0;
}
pre {
background: #fff;
}
@media only screen and (max-width: 780px) {
.demo {
margin: 5%;
width: 90%;
}
.how-use {
float: left;
width: 300px;
display: none;
}
}
</style>
</head>
<body>
<div class="demo">
<div>
<h1>Easy Responsive Tabs to Accordion</h1>
<p>Easy responsive tabs - is a lightweight jQuery plugin which optimizes normal horizontal or vertical tabs to accordion on multi devices like: web, tablets, Mobile (IPad & IPhone). This plugin adapts the screen size and changes its action accordingly.</p>
<h3>Features</h3>
<ul>
<li>Horizontal / Vertical Tabs to Accordion</li>
<li>Tabs and accordion are created entirely with jQuery</li>
<li>Supports multiple sets of tabs on same page</li>
<li>Cross browser compatibility (IE7+, Chrome, Firefox, Safari and Opera)</li>
<li>Multi device support (Web, Tablets & Mobile)</li>
</ul>
</div>
<h2 style="background: #7BC5FF; margin:30px 0 20px; padding: 1%; width: 98%;">Demo</h2>
<span style="font-size: 16px; color:#F00; margin-left: 10px; margin-bottom:40px; display:block; font-weight: normal;"><b>Note:</b> Media query breakpoint is set <b>768px</b>. Please resize the window to see "Tabs" to "Accordion"</span>
<!--Horizontal Tab-->
<div id="horizontalTab">
<ul class="resp-tabs-list">
<li>Responsive Tab-1</li>
<li>Responsive Tab-2</li>
<li>Responsive Tab-3</li>
</ul>
<div class="resp-tabs-container">
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nibh urna, euismod ut ornare non, volutpat vel tortor. Integer laoreet placerat suscipit. Sed sodales scelerisque commodo. Nam porta cursus lectus. Proin nunc erat, gravida a facilisis quis, ornare id lectus. Proin consectetur nibh quis urna gravida mollis.</p>
</div>
<div>
<p>This tab has icon in consectetur adipiscing eliconse consectetur adipiscing elit. Vestibulum nibh urna, ctetur adipiscing elit. Vestibulum nibh urna, t.consectetur adipiscing elit. Vestibulum nibh urna, Vestibulum nibh urna,it.</p>
</div>
<div>
<p>Suspendisse blandit velit Integer laoreet placerat suscipit. Sed sodales scelerisque commodo. Nam porta cursus lectus. Proin nunc erat, gravida a facilisis quis, ornare id lectus. Proin consectetur nibh quis Integer laoreet placerat suscipit. Sed sodales scelerisque commodo. Nam porta cursus lectus. Proin nunc erat, gravida a facilisis quis, ornare id lectus. Proin consectetur nibh quis urna gravid urna gravid eget erat suscipit in malesuada odio venenatis.</p>
</div>
</div>
</div>
<br />
<br />
<!--vertical Tabs-->
<div id="verticalTab">
<ul class="resp-tabs-list">
<li>Responsive Tab 1</li>
<li>Responsive Tab 2</li>
<li>Responsive Tab 3</li>
<li>Long name Responsive Tab 4</li>
</ul>
<div class="resp-tabs-container">
<div>
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum nibh urna, euismod ut ornare non, volutpat vel tortor. Integer laoreet placerat suscipit. Sed sodales scelerisque commodo. Nam porta cursus lectus. Proin nunc erat, gravida a facilisis quis, ornare id lectus. Proin consectetur nibh quis urna gravida mollis.</p>
</div>
<div>
<p>This tab has icon in it.</p>
</div>
<div>
<p>Suspendisse blandit velit Integer laoreet placerat suscipit. Sed sodales scelerisque commodo. Nam porta cursus lectus. Proin nunc erat, gravida a facilisis quis, ornare id lectus. Proin consectetur nibh quis Integer laoreet placerat suscipit. Sed sodales scelerisque commodo. Nam porta cursus lectus. Proin nunc erat, gravida a facilisis quis, ornare id lectus. Proin consectetur nibh quis urna gravid urna gravid eget erat suscipit in malesuada odio venenatis.</p>
</div>
<div>
<p>d ut ornare non, volutpat vel tortor. Integer laoreet placerat suscipit. Sed sodales scelerisque commodo. Nam porta cursus lectus. Proin nunc erat, gravida a facilisis quis, ornare id lectus. Proin consectetur nibh quis urna gravida mollis.Suspendisse blandit velit eget erat suscipit in malesuada odio venenatis.</p>
</div>
</div>
</div>
<br />
<div style="height: 30px; clear: both"></div>
<div class="how-use">
<h2>How to use</h2>
<ul>
<li>Add jQuery file (minimum jQuery-1.5.1.min.js)</li>
<li>Included easyResponsiveTabs.js</li>
<li>Include the css from responsive-tabs.css</li>
</ul>
Here is the Markup for Tabs structure:
<pre><code>
<div id="demoTab">
<ul class="resp-tabs-list">
<li> .... </li>
<li> .... </li>
<li> .... </li>
</ul>
<div class="resp-tabs-container">
<div> ....... </div>
<div> ....... </div>
<div> ....... </div>
</div>
</div>
</code></pre>
Call the easyResponsiveTabs function:
<pre><code>
$('#demoTab').easyResponsiveTabs();
</code></pre>
With optional parameters:
<pre><code>
$("#demoTab").easyResponsiveTabs({
type: 'default', //Types: default, vertical, accordion
width: 'auto', //auto or any custom width
fit: true // 100% fits in a container
});
</code></pre>
<br />
</div>
</div>
</body>
<script type="text/javascript">
$(document).ready(function () {
$('#horizontalTab').easyResponsiveTabs({
type: 'default', //Types: default, vertical, accordion
width: 'auto', //auto or any width like 600px
fit: true // 100% fit in a container
});
$('#verticalTab').easyResponsiveTabs({
type: 'vertical',
width: 'auto',
fit: true
});
});
</script>
</html>