zoukankan      html  css  js  c++  java
  • jQuery Mobile 工具栏

    jQuery Mobile 工具栏

    工具栏元素常被放置于页眉和页脚中 - 以实现“已访问”的导航:

    标题栏

    页眉通常会包含页眉标题/LOGO 或一到两个按钮(通常是首页、选项或搜索按钮)。

    您可以在页眉中向左侧或/以及右侧添加按钮。

    下面的代码,将向页眉标题文本的左侧添加一个按钮,并向右侧添加一个按钮:

    实例:

    <div data-role="header">
      <a href="#" data-role="button">首页</a>
      <h1>欢迎来到我的主页</h1>
      <a href="#" data-role="button">搜索</a>
    </div>

      

    下面的代码将向页眉标题的左侧添加一个按钮:

    <div data-role="header">
      <a href="#" data-role="button">首页</a>
      <h1>欢迎来到我的主页</h1>
    </div>

      

    不过,如果您在 <h1> 元素之后放置按钮链接,那么它不会显示在文本右侧。如需向页眉标题的右侧添加按钮,请规定类名 "ui-btn-right":

    实例:

    <div data-role="header">
      <h1>欢迎来到我的主页</h1>
      <a href="#" data-role="button" class="ui-btn-right">搜索</a>
    </div>

      

    提示:页眉可包含一个或两个按钮,然而页脚没有限制。

    页脚栏

    与页眉相比,页脚更具伸缩性 - 它们更实用且多变,所以能够包含所需数量的按钮:

    实例:

    <div data-role="footer">
      <a href="#" data-role="button">转播到新浪微博</a>
      <a href="#" data-role="button">转播到腾讯微博</a>
      <a href="#" data-role="button">转播到 QQ 空间</a>
    </div>

      

    注释:页脚与页眉的样式不同(它会减去一些内边距和空白,并且按钮不会居中)。如果要修正该问题,请在页脚设置类名 "ui-btn":

    实例:

    <div data-role="footer" class="ui-btn">
    

      

    您也能够选择在页脚中水平还是垂直地组合按钮:

    实例:

    <div data-role="footer" class="ui-btn">
      <div data-role="controlgroup" data-type="horizontal">
        <a href="#" data-role="button" data-icon="plus">转播到新浪微博</a>
        <a href="#" data-role="button" data-icon="plus">转播到腾讯微博</a>
        <a href="#" data-role="button" data-icon="plus">转播到 QQ 空间</a>
      </div>
    </div>

     

    定位页眉和页脚

    放置页眉和页脚的方式有三种:

    • Inline - 默认。页眉和页脚与页面内容位于行内。
    • Fixed - 页面和页脚会留在页面顶部和底部。
    • Fullscreen - 与 fixed 类似;页面和页脚会留在页面顶部和底部,but also over the page content. It is also slightly see-through

    请使用 data-position 属性来定位页眉和页脚:

    Inline 定位(默认)

    <div data-role="header" data-position="inline"></div>
    <div data-role="footer" data-position="inline"></div>

      

    固定定位

    Fixed 定位

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

    浮动定位(浮动在上下两端)

    如果需要启用全面定位,请使用 data-position="fixed",并向该元素添加 data-fullscreen 属性:

     

    Fullscreen 定位

    <div data-role="header" data-position="fixed" data-fullscreen="true"></div>
    <div data-role="footer" data-position="fixed" data-fullscreen="true"></div>

     

    浮动并透明

    提示:fullscreen 对于照片、图像和视频非常理想。

    提示:对于 fixed 和 fullscreen 定位,触摸屏幕将隐藏和显示页眉及页脚。

     

  • 相关阅读:
    [enum]enum的用法
    gridview汇出EXCEL (ExportGridViewToExcel(dt, HttpContext.Current.Response);)
    c#用正则表达式判断字符串是否全是数字、小数点、正负号组成 Regex reg = new Regex(@"^(([0-9]+.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*.[0-9]+)|([0-9]*[1-9][0-9]*))$");
    GridView里的文本框改变事件
    转发 win7+iis7.5+asp.net下 CS0016: 未能写入输出文件“c:WindowsMicrosoft.NETFrameworkv2.0.50727Temporary ASP.NET Files 解决方案
    验证上转文件类型的正则表达式
    EXCEL设置选中单元格样式
    转发!HTML 复选框 checkbox 的 JavaScript 的全选和全反选
    dataGrid转换dataTable
    wince mobile环境下播放WAV声音
  • 原文地址:https://www.cnblogs.com/gzh9588/p/6121653.html
Copyright © 2011-2022 走看看