前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >jQuery Mobile的学习 jQuery Mobile工具栏、标题栏、页脚栏的定位学习

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

作者头像
业余草
发布2019-01-21 16:00:31
1.7K0
发布2019-01-21 16:00:31
举报
文章被收录于专栏:业余草业余草

程序员都很赖,你懂的! 最近在做html5页面的开发,主要做智能终端设备的开发。对于内容比较少的页面,领导提出了要将页眉和页脚定位到网页的最上方和最下方。对于这样的要求,其实一点也不过分。但对于新手来说,确实很难,很不容易,今天我就将我学习的内容一起分享一下! 放置页眉和页脚的方式有三种:     Inline - 默认。页眉和页脚与页面内容位于行内。     Fixed - 页面和页脚会留在页面顶部和底部。     Fullscreen - 与 fixed 类似;页面和页脚会留在页面顶部和底部 请使用 data-position 属性来定位页眉和页脚:  看代码:

代码语言:javascript
复制
<!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

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
原始发表:2014年05月29日,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档