Skip to content

Commit 4fda203

Browse files
committed
API docs: tidied up mobile header and footer entries and examples
1 parent 2397906 commit 4fda203

File tree

10 files changed

+170
-180
lines changed

10 files changed

+170
-180
lines changed

entries/footer.xml

Lines changed: 40 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -2,66 +2,66 @@
22
<?xml-stylesheet type="text/xsl" href="../entries2html.xsl" ?>
33
<entry name="footer" namespace="fn" type="widget" widgetnamespace="mobile">
44
<title>Footer Widget</title>
5-
<desc>The <strong>Footer bar</strong> is usually the last element inside each mobile page, and tends to be more freeform than the header in terms of content and functionality, but typically contains a combination of text and buttons.</desc>
6-
<longdesc>
7-
<h2>Footer bar structure</h2>
8-
<p>The <code>footer</code> bar has the same basic structure as the header except it uses the <code> data-role</code> attribute value of <code>footer</code>.</p>
5+
<desc>Creates a footer widget</desc>
6+
<longdesc>
7+
The Footer bar is usually the last element inside each mobile page, and tends to be more freeform than the header in terms of content and functionality, but typically contains a combination of text and buttons.
98

10-
<pre>
11-
<span class="nt">&lt;div</span> <strong><span class="na">data-role=</span><span class="s">"footer"</span></strong><span class="nt">&gt;</span>
12-
<span class="nt">&lt;h4&gt;</span>Footer content<span class="nt">&lt;/h4&gt;</span>
13-
<span class="nt">&lt;/div&gt;</span>
14-
</pre>
9+
<h3>Footer bar structure</h3>
10+
<p>The <code>footer</code> bar has the same basic structure as the header except it uses the <code> data-role</code> attribute value of <code>footer</code>.</p>
1511

16-
<p>The <code>footer</code> toolbar will be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.
17-
<iframe src="/resources/footer/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>
12+
<pre><code>
13+
&lt;div data-role="footer"&gt;
14+
&lt;h4&gt;Footer content&lt;/h4&gt;
15+
&lt;/div&gt;
16+
</code></pre>
1817

19-
<p>The page footer is very similar to the header in terms of options and configuration. The primary difference is that the footer is designed to be less structured than the header to allow more flexibility, so the framework doesn't automatically reserve slots for buttons to the left or right as it does in headers.</p>
20-
<p>Since footers do not have the same prescriptive markup conventions as headers, we recommend using layout grids or writing custom styles to achieve the design you want.</p>
18+
<p>The <code>footer</code> toolbar will be themed with the "a" swatch by default (black in the default theme) but you can easily set the theme swatch color.
19+
<iframe src="/resources/footer/example1.html" style="width:100%;height:90px;border:0px"></iframe></p>
2120

22-
<h2>Adding buttons</h2>
23-
<p>Any link or valid button markup added to the footer will automatically be turned into a button. To save space, buttons in toolbars are automatically set to inline styling so the button is only as wide as the text and icons it contains.</p>
24-
<p>By default, toolbars don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a <code>class="ui-bar"</code> to the footer.</p>
21+
<p>The page footer is very similar to the header in terms of options and configuration. The primary difference is that the footer is designed to be less structured than the header to allow more flexibility, so the framework doesn't automatically reserve slots for buttons to the left or right as it does in headers.</p>
22+
<p>Since footers do not have the same prescriptive markup conventions as headers, we recommend using layout grids or writing custom styles to achieve the design you want.</p>
2523

24+
<h3>Adding buttons</h3>
25+
<p>Any link or valid button markup added to the footer will automatically be turned into a button. To save space, buttons in toolbars are automatically set to inline styling so the button is only as wide as the text and icons it contains.</p>
26+
<p>By default, toolbars don't have any padding to accommodate nav bars and other widgets. To include padding on the bar, add a <code>class="ui-bar"</code> to the footer.</p>
2627

27-
<pre><code>
28-
&lt;div data-role=&quot;footer&quot; class=&quot;ui-bar&quot;&gt;
29-
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;plus&quot;&gt;Add&lt;/a&gt;
30-
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;arrow-u&quot;&gt;Up&lt;/a&gt;
31-
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;arrow-d&quot;&gt;Down&lt;/a&gt;
32-
&lt;/div&gt;
33-
</code></pre>
28+
<pre><code>
29+
&lt;div data-role=&quot;footer&quot; class=&quot;ui-bar&quot;&gt;
30+
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;plus&quot;&gt;Add&lt;/a&gt;
31+
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;arrow-u&quot;&gt;Up&lt;/a&gt;
32+
&lt;a href=&quot;index.html&quot; data-role=&quot;button&quot; data-icon=&quot;arrow-d&quot;&gt;Down&lt;/a&gt;
33+
&lt;/div&gt;
34+
</code></pre>
3435

35-
<p>This creates this toolbar with buttons sitting in a row
36-
<iframe src="/resources/footer/example2.html" style="width:100%;height:90px;border:0px"></iframe></p>
36+
<p>This creates this toolbar with buttons sitting in a row
37+
<iframe src="/resources/footer/example2.html" style="width:100%;height:90px;border:0px"></iframe></p>
3738

38-
<p>Note that <code>.ui-bar</code> should not be added to header or footer bars that span the full width of the page, as the additional padding will cause a full-width element to break out of its parent container. To add padding inside of a full-width toolbar, wrap the toolbar's contents in an element and apply the padding to that element.</p>
39+
<p>Note that <code>.ui-bar</code> should not be added to header or footer bars that span the full width of the page, as the additional padding will cause a full-width element to break out of its parent container. To add padding inside of a full-width toolbar, wrap the toolbar's contents in an element and apply the padding to that element.</p>
3940

40-
<p>To group buttons together into a button set, wrap the links in a wrapper with <code> data-role=&quot;controlgroup&quot;</code> and <code>data-type=&quot;horizontal&quot;</code> attributes.</p>
41+
<p>To group buttons together into a button set, wrap the links in a wrapper with <code> data-role=&quot;controlgroup&quot;</code> and <code>data-type=&quot;horizontal&quot;</code> attributes.</p>
4142

42-
<code>&lt;div data-role=&quot;controlgroup&quot; data-type=&quot;horizontal&quot;&gt;</code>
43+
<code>&lt;div data-role=&quot;controlgroup&quot; data-type=&quot;horizontal&quot;&gt;</code>
4344

44-
<p>This creates a grouped set of buttons:
45-
<iframe src="/resources/footer/example3.html" style="width:100%;height:90px;border:0px"></iframe></p>
45+
<p>This creates a grouped set of buttons:
46+
<iframe src="/resources/footer/example3.html" style="width:100%;height:90px;border:0px"></iframe></p>
4647

47-
<h2>Adding form elements</h2>
48-
<p>Form elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar. We recommend using mini-sized form elements in toolbars by adding the <code>data-mini="true"</code> attribute:
49-
<iframe src="/resources/footer/example4.html" style="width:100%;height:90px;border:0px"></iframe></p>
48+
<h3>Adding form elements</h3>
49+
<p>Form elements and other content can also be added to toolbars. Here is an example of a select menu inside a footer bar. We recommend using mini-sized form elements in toolbars by adding the <code>data-mini="true"</code> attribute:
50+
<iframe src="/resources/footer/example4.html" style="width:100%;height:90px;border:0px"></iframe></p>
5051

51-
5252

53-
<h2>Fixed &amp; Persistent footers</h2>
54-
<p>In situations where the footer is a global navigation element, you may want it to appear fixed so it doesn't scroll out of view. It's also possible to make a fixed toolbar persistent so it appears to not move between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.</p>
55-
<p>To make a footer persistent between transitions, add the <code>data-id</code> attribute to the footer of all relevant pages and use the same <code>id</code> value for each. For example, by adding <code>data-id="myfooter"</code> to the current page and the target page, the framework will keep the footer anchors in the same spot during the page animation. <strong>This effect will only work correctly if the header and footer toolbars are set to <code>data-position="fixed"</code> so they are in view during the transition.</strong></p>
53+
<h3>Fixed &amp; Persistent footers</h3>
54+
<p>In situations where the footer is a global navigation element, you may want it to appear fixed so it doesn't scroll out of view. It's also possible to make a fixed toolbar persistent so it appears to not move between page transitions. This can be accomplished by using the persistent footer feature included in jQuery Mobile.</p>
55+
<p>To make a footer persistent between transitions, add the <code>data-id</code> attribute to the footer of all relevant pages and use the same <code>id</code> value for each. For example, by adding <code>data-id="myfooter"</code> to the current page and the target page, the framework will keep the footer anchors in the same spot during the page animation. <strong>This effect will only work correctly if the header and footer toolbars are set to <code>data-position="fixed"</code> so they are in view during the transition.</strong></p>
5656
</longdesc>
5757
<added>1.0</added>
5858
<example>
5959
<desc>A basic example of a footer</desc>
6060
<code><![CDATA[]]></code>
6161
<html><![CDATA[
62-
<div data-role="footer">
63-
<h4>Footer content</h4>
64-
</div> ]]></html>
62+
<div data-role="footer">
63+
<h4>Footer content</h4>
64+
</div> ]]></html>
6565
</example>
6666
<category slug="widgets"/>
6767
</entry>

0 commit comments

Comments
 (0)