forked from petelove666/Responsive-Tabs
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
84 lines (74 loc) · 2.86 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
<!doctype html>
<head>
<title>Responsive Tabs Demo - Pete Love</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="css/responsive-tabs.css">
<link rel="stylesheet" href="http://twitter.github.io/bootstrap/assets/css/bootstrap.css">
<link rel="stylesheet" href="http://fortawesome.github.io/Font-Awesome/assets/font-awesome/css/font-awesome.min.css">
<style type="text/css">
/* Styles for demo page only - not required */
body {
padding:15px 20px;
}
</style>
</head>
<body>
<h1>Responsive Tabs Demo</h1>
<div class="alert alert-info">
<p>In this example, the <strong>media query breakpoint is set 768px</strong>.</p>
<p>Resize window below 768px and controls will be an accordion.<br/>Resize to 768px or above and they will appear as regular bootstrap tabs.</p>
</div>
<div class="responsive-tabs">
<h4>Key features</h4>
<div>
<ul>
<li>Progressive enhancement - uses semantic heading/content markup - tabs and accordion are created entirely with jQuery</li>
<li>Uses Aria attributes and roles to aid screen reader accessibility</li>
<li>Tabs and their content are fully accessible via keyboard</li>
<li>Supports multiple sets of tabs on same page</li>
</ul>
</div>
<h4>How to use</h4>
<div>
<ol>
<li>Include jQuery (minimum version 1.5.1 and above)</li>
<li>Include responsiveTabs.js</li>
<li>Include the css from responsive-tabs.css, and adjust the media query breakpoint as desired</li>
<li>Markup your tabs regions as follows:
<code><pre>
<div class="tabs">
<h2>[...]</h2>
<div>[...]</div>
<h2>[...]</h2>
<div>[...]</div>
</div>
</pre></code>
<span>The headings can be any level, from h1 to h6. Note that the first (leftmost) tab panel will be open by default in 'tab view', while all panels will be closed in 'accordion view' (ie. below the specified breakpoint).</span>
<p>If you want a specific tab other than the first to be open by default then add the class 'responsive-tabs__panel--active' onto the panel, eg:</p>
<code><pre>
<div class="tabs">
<h2>[...]</h2>
<div>[...]</div>
<h2>[...]</h2>
<div class="responsive-tabs__panel--active">[...]</div>
</div>
</pre></code>
</li>
<li>On document ready, call the function responsiveTabs() </li>
</ol>
</div>
<h4>Download</h4>
<div>
<p>responsiveTabs.js is available for download on Github</p>
<a class="btn btn-primary" href="https://github.com/thecrag/responsive-bootstrap-tabs">Download from Github</a>
</div>
</div>
<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<script src="js/responsiveTabs.js"></script>
<script>
$(document).ready(function() {
RESPONSIVEUI.responsiveTabs();
})
</script>
</body>
</html>