jQuery Mobile的学习 jQuery Mobile工具栏、标题栏、页脚栏的定位学习

程序猿都非常赖。你懂的!
近期在做html5页面的开发,主要做智能终端设备的开发。对于内容比較少的页面,领导提出了要将页眉和页脚定位到网页的最上方和最下方。对于这种要求,事实上一点也只是分。但对于新手来说,确实非常难,非常不easy。今天我就将我学习的内容一起分享一下。
放置页眉和页脚的方式有三种:
    Inline - 默认。页眉和页脚与页面内容位于行内。
    Fixed - 页面和页脚会留在页面顶部和底部。
    Fullscreen - 与 fixed 类似;页面和页脚会留在页面顶部和底部
请使用 data-position 属性来定位页眉和页脚:
 看代码:
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head>
<body>

<div data-role="page">
  <div data-role="header" data-position="fixed">
    <h1>Fixed 页眉</h1>
  </div>

  <div data-role="content">
    <p><b>提示:</b>假设要看到效果,则须要调整窗体大小使滚动栏可用。

</p> <p><b>提示:</b>假设滚动栏可用,那么敲击屏幕将隐藏或显示页眉/页脚。效果会依据您在页面上的位置而变化。

</p> <p>Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling. to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..Some text to enable scrolling..</p> </div> <div data-role="footer" data-position="fixed"> <h1>Fixed 页脚</h1> </div> </div> </body> </html>

ok。我们上截图:

  点击下载资料:http://download.csdn.net/download/xmt1139057136/7422831
假设你还有不懂。请加qq群: 135430763共同学习。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值