Skip to content

Commit b733b36

Browse files
kborchersjzaefferer
authored andcommitted
Tabs: Document the expected markup. Fixes #133. Closes gh-163
1 parent 54ca0f4 commit b733b36

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

entries/tabs.xml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,36 @@
44
<desc>A single content area with multiple panels, each associated with a header in a list.</desc>
55
<longdesc>
66
<p>Tabs are generally used to break content into multiple sections that can be swapped to save space, much like an accordion.</p>
7+
<p>Tabs have a particular set of markup that must be used in order for them to work properly:</p>
8+
<ul>
9+
<li>The tabs themselves must be in either an ordered (<code>&lt;ol></code>) or unordered (<code>&lt;ul></code>) list</li>
10+
<li>Each tab "title" must be inside of a list item (<code>&lt;li></code>) and wrapped by an anchor (<code>&lt;a></code>) with an <code>href</code> attribute</li>
11+
<li>Each tab panel may be any valid element but it must have an id which corresponds to the hash in the anchor of the associated tab.</li>
12+
</ul>
713

814
<p>The content for each tab panel can be defined in-page or can be loaded via Ajax; both are handled automatically based on the <code>href</code> of the anchor associated with the tab. By default tabs are activated on click, but the events can be changed to hover via the <a href="#option-event"><code>event</code></a> option.</p>
915

16+
<p>Below is some sample markup:</p>
17+
18+
<pre><code><![CDATA[
19+
<div id="tabs">
20+
<ul>
21+
<li><a href="#fragment-1">One</a></li>
22+
<li><a href="#fragment-2">Two</a></li>
23+
<li><a href="#fragment-3">Three</a></li>
24+
</ul>
25+
<div id="fragment-1">
26+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
27+
</div>
28+
<div id="fragment-2">
29+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
30+
</div>
31+
<div id="fragment-3">
32+
Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.
33+
</div>
34+
</div>
35+
]]></code></pre>
36+
1037
<h3>Keyboard interaction</h3>
1138

1239
<p>When focus is on a tab, the following key commands are available:</p>

0 commit comments

Comments
 (0)