列表页

为header或者footer添加 data-position="fixed",可以让他们固定在屏幕的边缘。

可以通过给ul设置data-role="listview"来将一个普通的列表转换成一个非常华丽如同本地APP一般的列表样式

为li元素添加data-role="list-divider"即可实现分隔符的效果

还可以为列表添加小气泡来展示一些附加数据 <span class="ui-li-count">I love You</span>

<meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">

<link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.css">

<script src="http://code.jquery.com/jquery-1.5.min.js"></script>

<script src="http://code.jquery.com/mobile/1.0a4.1/jquery.mobile-1.0a4.1.min.js"></script>

<div data-role="page">

<!--为header或者footer添加 data-position="fixed",可以让他们固定在屏幕的边缘。-->

<div data-role="header" data-position="fixed">

      <h1>Navigation</h1>

   </div><!-- /header -->

   <div data-role="content" >

    <!--设置data-role="listview"来将一个普通的列表转换成一个非常华丽如同本地APP一般的列表样式-->

      <ul data-role="listview" data-dividertheme="d" style="margin-top: 0;">

         <li data-role="list-divider">Royal Family</li>

         <!--还可以为列表添加小气泡来展示一些附加数据-->

         <li><a href="#nav1">Henry VIII <span class="ui-li-count">I love You</span></a></li>

         <li><a href="#nav1">George V</a></li>

         <li><a href="#nav1">Prince of Wales</a></li>

         <li><a href="#nav1">Elizabeth I</a></li>

         <li><a href="#nav1">Elizabeth II</a></li>

         <!--为li元素添加data-role="list-divider"即可实现分隔符的效果-->

         <li data-role="list-divider">Prime Miniseters</li>

         <li><a href="#nav2">Winston Churchill</a></li>

         <li><a href="#nav2">Tony Blare</a></li>

         <li><a href="#nav2">David Cameron</a></li>

      </ul>

   </div><!-- /content -->

<div data-role="footer" data-position="fixed">

   <div data-role="navbar">

      <ul>

         <li><a href="#nav1" class="ui-btn-active">Royals</a></li>

         <li><a href="#nav2">Leaders</a></li>

      </ul>

   </div><!-- /navbar -->

</div><!-- /footer -->

</div><!-- /page -->

<div data-role="page" id="nav1" data-position="fixed">

   <div data-role="header">

      <h1>Royal Family</h1>

   </div><!-- /header -->

<div data-role="content">

<p>Members and relatives of the British Royal Family historically represented the monarch in various places throughout the British Empire, sometimes for extended periods as viceroys, or for specific ceremonies or events. Today, they often perform ceremonial and social duties throughout the United Kingdom and abroad on behalf of the UK, but, aside from the monarch, have no constitutional role in the affairs of government. This is the same for the other realms of the Commonwealth though the family there acts on behalf of, is funded by, and represents the sovereign of that particular state, and not the United Kingdom.</P>

</div><!-- /content -->

   <div data-role="footer" data-position="fixed">

      <h4>Royal Family</h4>

   </div><!-- /header -->

</div><!-- /page -->

<div data-role="page" id="nav2" data-position="fixed">

   <div data-role="header">

      <h1>Prime Ministers</h1>

   </div><!-- /header -->

<div data-role="content">

The Prime Minister of the United Kingdom of Great Britain and Northern Ireland is the Head of Her Majesty's Government in the United Kingdom. The Prime Minister and Cabinet (consisting of all the most senior ministers, who are government department heads) are collectively accountable for their policies and actions to the Sovereign, to Parliament, to their political party and ultimately to the electorate. The current Prime Minister, David Cameron, was appointed on 11 May 2010.</div><!-- /content -->

<div data-role="footer" data-position="fixed">

   <h4>Prime Minister</h4>

      </div><!-- /header -->

   </div><!-- /page -->

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值