jQuery Mobile - 页脚中的按钮
描述
ui-btn-left 和 ui-btn-right 类不能在页脚中使用。 但是,您仍然可以使用自定义 CSS 创建相同的外观。
示例
以下示例演示了在 jQuery Mobile 中使用 页脚中的按钮。
<!DOCTYPE html>
<html>
<head>
<title>Buttons in footers</title>
<meta name = "viewport" content = "width = device-width, initial-scale = 1">
<link rel = "stylesheet" href = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.css">
<script src = "https://code.jquery.com/jquery-1.11.3.min.js"></script>
<script src = "https://code.jquery.com/mobile/1.4.5/jquery.mobile-1.4.5.min.js"></script>
<style>
.footer-button-left,
.footer-button-right {
position: absolute;
margin: 0;
top: auto;
bottom: 0.24em;
}
.footer-button-left {
left: 0.4em;
}
.footer-button-right {
right: 0.4em;
}
</style>
</head>
<body>
<div data-role = "footer">
<h2>Footer</h2>
<a href = "#" class = "ui-btn ui-corner-all ui-btn-inline ui-mini
footer-button-left ui-btn-icon-left ui-icon-home">Home</a>
<a href = "#" class = "ui-btn ui-corner-all ui-btn-inline ui-mini
footer-button-right ui-btn-icon-right ui-icon-gear">Options</a>
</div>
</body>
</html>
输出
让我们执行以下步骤,看看上面的代码是如何工作的 −
将上述 html 代码保存为服务器根文件夹中的 toolbar_buttons_footer.html 文件。
将此 HTML 文件打开为 http://localhost/toolbar_buttons_footer.html,将显示以下输出。

