jQuery Mobile 导航栏

导航栏只需要把data-role="navbar"即可,如果需要制定选定的,需要添加样式class="ui-btn-active"

<!DOCTYPE html>
<html>
<head>
    <title>jQuery Mobile 尾部导航栏</title>
    <meta name="viewport" content="width=device-width,
           initial-scale=1" /> 
    <link  href="Css/jquery.mobile-1.0.1.min.css" 
           rel="Stylesheet" type="text/css" />
    <script src="Js/jquery-1.6.4.js" 
           type="text/javascript"></script>
    <script src="Js/jquery.mobile-1.0.1.js" 
           type="text/javascript"></script>
</head>
<body>
  <div data-role="page">
   <div data-role="header"><h1>头部栏标题</h1></div>
  <div data-role="content">
    <p>添加尾部导航栏</p>
  </div>
  <div data-role="footer">
    <div data-role="navbar">
      <ul>
        <li><a href="a.html" class="ui-btn-active">北京</a></li>
        <li><a href="b.html">上海</a></li>
        <li><a href="b.html">广州</a></li>
      </ul>
    </div>
  </div>
 </div>
</body>
</html>

  data-icon="info" 指定图标 data-iconpos="bottom"指定图标的位置

<div data-role="navbar" data-iconpos="bottom">
        <ul>
          <li><a href="#" data-icon="info" class="ui-btn-active">图书</a></li>
          <li><a href="#e2" data-icon="alert">音乐</a></li>
          <li><a href="#" data-icon="gear">影视</a></li>
        </ul>
      </div>

相关推荐