-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtabs.html
More file actions
73 lines (61 loc) · 4.74 KB
/
tabs.html
File metadata and controls
73 lines (61 loc) · 4.74 KB
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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Tab Panels</title>
<meta charset="utf-8">
<link href="css/navs.css" rel="stylesheet">
<link href="css/app.css" rel="stylesheet">
</head>
<body>
<div class="container">
<h2>Example tabs</h2>
<p>Add quick, dynamic tab functionality to transition through panes of local content, even via dropdown menus.</p>
<div class="bs-docs-example">
<ul id="myTab" class="nav nav-tabs">
<li class="active"><a href="#home" data-toggle="tab">Home</a></li>
<li><a href="#profile" data-toggle="tab">Profile</a></li>
<li><a href="#about" data-toggle="tab">About</a></li>
</ul>
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade in active" id="home">
<p>Raw denim you probably haven't heard of them jean shorts Austin. Nesciunt tofu stumptown aliqua, retro synth master cleanse. Mustache cliche tempor, williamsburg carles vegan helvetica. Reprehenderit butcher retro keffiyeh dreamcatcher synth. Cosby sweater eu banh mi, qui irure terry richardson ex squid. Aliquip placeat salvia cillum iphone. Seitan aliquip quis cardigan american apparel, butcher voluptate nisi qui.</p>
</div>
<div class="tab-pane fade" id="profile">
<p>Food truck fixie locavore, accusamus mcsweeney's marfa nulla single-origin coffee squid. Exercitation +1 labore velit, blog sartorial PBR leggings next level wes anderson artisan four loko farm-to-table craft beer twee. Qui photo booth letterpress, commodo enim craft beer mlkshk aliquip jean shorts ullamco ad vinyl cillum PBR. Homo nostrud organic, assumenda labore aesthetic magna delectus mollit. Keytar helvetica VHS salvia yr, vero magna velit sapiente labore stumptown. Vegan fanny pack odio cillum wes anderson 8-bit, sustainable jean shorts beard ut DIY ethical culpa terry richardson biodiesel. Art party scenester stumptown, tumblr butcher vero sint qui sapiente accusamus tattooed echo park.</p>
</div>
<div class="tab-pane fade" id="about">
<p>Etsy mixtape wayfarers, ethical wes anderson tofu before they sold out mcsweeney's organic lomo retro fanny pack lo-fi farm-to-table readymade. Messenger bag gentrify pitchfork tattooed craft beer, iphone skateboard locavore carles etsy salvia banksy hoodie helvetica. DIY synth PBR banksy irony. Leggings gentrify squid 8-bit cred pitchfork. Williamsburg banh mi whatever gluten-free, carles pitchfork biodiesel fixie etsy retro mlkshk vice blog. Scenester cred you probably haven't heard of them, vinyl craft beer blog stumptown. Pitchfork sustainable tofu synth chambray yr.</p>
</div>
</div>
</div>
</div>
<script src="js/tabs.js"></script>
<div id="code">
<h2>Expected Markup</h2>
<pre><code class="language-html">
<ul id="myTab" role="tablist">
<li class="active" role="none"><a href="#home" role="tab" id="tab1" tabindex="0" aria-selected="true" aria-controls="home">Home</a></li>
<li role="none"><a href="#profile" role="tab" id="tab2" tabindex="-1" aria-selected="false" aria-controls="profile">Profile</a></li>
</ul>
<div class="tab-pane fade in active" id="home" role="tabpanel" tabindex="0" aria-hidden="false" aria-labelledby="tab1">Content1</div>
<div class="tab-pane fade" id="home" role="tabpanel" tabindex="-1" aria-hidden="true" aria-labelledby="tab2">Content2</div>
</code></pre>
<h3>Explanation</h3>
<ol>
<li>Wrapper UL has the role of tablist, anchors that recieve the focus are tab and the main content is in tabpanel. </li>
<li>LI should have a role of none to remove it from AOM</li>
<li>selected tab should have tabindex 0 and rest of the tabs should be removed from taborder to have single tabstop</li>
<li>aria-controls for tab and it points to respective tabpanel. Jaws screen reader users can move to controlled element with shortcut control+M</li>
<li>Tab panel should have labelledby to reverse point to the respective tab</li>
</ol>
<link rel="stylesheet" href="lib/css/tomorrow-night-blue.min.css">
<script src="lib/js/highlight.min.js"></script>
<script>
document.querySelectorAll("code").forEach(function(element) {
element.innerHTML = element.innerHTML.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
});
hljs.highlightAll();
</script>
</div><!--code-->
</body>
</html>