Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Commit 27d808a

Browse files
author
Gabriel Schulhof
committed
Toolbar: Demo the use of custom CSS to add left/right buttons to footer
Closes gh-7635 Fixes gh-7634
1 parent 7e9209e commit 27d808a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

demos/toolbar/index.php

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,21 @@
1111
<script src="../../external/jquery/jquery.js"></script>
1212
<script src="../_assets/js/"></script>
1313
<script src="../../js/"></script>
14+
<style id="footer-abs-buttons">
15+
.footer-button-left,
16+
.footer-button-right {
17+
position: absolute;
18+
margin: 0;
19+
top: auto;
20+
bottom: 0.24em;
21+
}
22+
.footer-button-left {
23+
left: 0.4em;
24+
}
25+
.footer-button-right {
26+
right: 0.4em;
27+
}
28+
</style>
1429
</head>
1530
<body>
1631
<div data-role="page" class="jqm-demos" data-quicklinks="true">
@@ -118,6 +133,18 @@
118133
</div>
119134
</div><!-- /demo-html -->
120135

136+
<h3>Buttons in footers</h3>
137+
138+
<p>The classes <code>ui-btn-left</code> and <code>ui-btn-right</code> were not meant to be used in footers, because they do not account for the possible presence of text, navbars, and and other elements often present in footers. You can nevertheless achieve a similar effect when you add a bit of custom CSS.</p>
139+
140+
<div data-demo-html="true" data-demo-css="#footer-abs-buttons">
141+
<div data-role="footer">
142+
<h2>Footer</h2>
143+
<a href="#" class="ui-btn ui-corner-all ui-btn-inline ui-mini footer-button-left ui-btn-icon-left ui-icon-power">Quit</a>
144+
<a href="#" class="ui-btn ui-corner-all ui-btn-inline ui-mini footer-button-right ui-btn-icon-right ui-icon-carat-r">Next</a>
145+
</div>
146+
</div>
147+
121148
<h2>Adding back button to header</h2>
122149

123150
<p>jQuery Mobile has a feature to automatically create and append "back" buttons to any header, though it is disabled by default. This is primarily useful in chromeless installed applications, such as those running in a native app webview. The framework automatically generates a "back" button on a header when the page plugin's <code>addBackBtn</code> option is true. This can also be set via markup if the header has a <code>data-add-back-btn="true"</code> attribute.</p>

0 commit comments

Comments
 (0)