1、主题

jQuery Mobile 提供了5种不同的主题样式, 从 "a" 到 "e" - 每一种主题的按钮,工具条,内容块等等颜色都不一致,每个主题的视觉效果也不一样。

通过设置元素的data-theme属性可以自定义应用的外观:

<div data-role="page" data-theme="a|b|c|d|e">
 

主题头部,内容和底部

<div data-role="header" data-theme="b"></div>

<div data-role="content" data-theme="a"></div>

<div data-role="footer" data-theme="e"></div>

主题对话框

<a href="#pagetwo" data-rel="dialog">Go To The Themed Dialog Page</a>

<div data-role="page" id="pagetwo" data-overlay-theme="e">
<div data-role="header" data-theme="b"></div>
<div data-role="content" data-theme="a"></div>
<div data-role="footer" data-theme="c"></div>
</div>

主题按钮

<a href="#" data-role="button" data-theme="a">Button</a>

主题图标

<a href="#" data-role="button" data-icon="plus" data-theme="e">Plus</a

头部和底部的主题按钮

<div data-role="header">
<a href="#" data-role="button" data-icon="home" data-theme="b">Home</a>
<h1>Welcome To My Homepage</h1>
<a href="#" data-role="button" data-icon="search" data-theme="e">Search</a>
</div> <div data-role="footer">
<a href="#" data-role="button" data-theme="b" data-icon="plus">Button 1</a>
<a href="#" data-role="button" data-theme="c" data-icon="plus">Button 2</a>
<a href="#" data-role="button" data-theme="e" data-icon="plus">Button 3</a>
</div>

主题导航条

<div data-role="footer" data-theme="e">
<h1>Insert Footer Text Here</h1>
<div data-role="navbar">
<ul>
<li><a href="#" data-icon="home" data-theme="b">Button 1</a></li>
<li><a href="#" data-icon="arrow-r">Button 2</a></li>
<li><a href="#" data-icon="arrow-r">Button 3</a></li>
<li><a href="#" data-icon="search" data-theme="a" >Button 4</a></li>
</ul>
</div>
</div>

主题可折叠按钮和内容

<div data-role="collapsible" data-theme="b" data-content-theme="e">
<h1>Click me - I'm collapsible!</h1>
<p>I'm the expanded content.</p>
</div>

主题列表

<ul data-role="listview" data-theme="e">
<li><a href="#">List Item</a></li>
<li data-theme="a"><a href="#">List Item</a></li>
<li data-theme="b"><a href="#">List Item</a></li>
<li><a href="#">List Item</a></li>
</ul>

主题分割按钮

<ul data-role="listview" data-split-theme="e">

主题可折叠列表

<div data-role="collapsible" data-theme="b" data-content-theme="e">
<ul data-role="listview">
<li><a href="#">Agnes</a></li>
</ul>
</div>

主题表单

<label for="name">Full Name:</label>
<input type="text" name="text" id="name" data-theme="a"> <label for="colors">Choose Favorite Color:</label>
<select id="colors" name="colors" data-theme="b">
<option value="red">Red</option>
<option value="green">Green</option>
<option value="blue">Blue</option>
</select>

主题可折叠表单

<fieldset data-role="collapsible" data-theme="b" data-content-theme="e">
<legend>Click me - I'm collapsible!</legend>

添加新主题

jQuery Mobile 可以在移动页面添加新主题。

通过修改 CSS 文件来添加或编辑新主题(如果你已经下载了 jQuery Mobile)。你只需要拷贝样式模块,然后重命令字母类名(f-z),并在样式中添加你喜欢的颜色和字体。

你也可以在 HTML 文档中添加主题的新样式 - 工具条添加类: ui-bar-(a-z) ,文本内容添加类: ui-body-(a-z) for the content:

<style>
.ui-bar-f
{
color:green;
background-color:yellow;
}
.ui-body-f
{
font-weight:bold;
color:purple;
}
</style>
 
 
 

jQuery Mobile 基础(第四章)的更多相关文章

  1. jQuery Mobile 基础(第三章)

    1.表单: 表单控件: 文本输入框 搜索输入框 单选按钮 复选框 选择菜单 滑动条 翻转拨动开关 fileld容器:如需让标签和表单元素看起来更适应宽屏,请用带有 data-role="fi ...

  2. jQuery Mobile 基础(第二章)

    1.可折叠块: <div data-role="collapsible"> <h1>点击我 - 我可以折叠!</h1> <p>我是可 ...

  3. html5文章 -- 使用 jQuery Mobile 与 HTML5 开发 Web App —— jQuery Mobile 基础

    这篇文章是使用 jQuery Mobile 与 HTML5 开发 Web App 系列的第二篇,在本文以及接下来的数篇文章 Kayo 将会介绍 jQuery Mobile 的组件.事件响应以及可以调用 ...

  4. Android+Jquery Mobile学习系列(2)-HTML5/Jquery Mobile基础

    本章介绍两个关键字[HTML5]和[Jquery Mobile],简单说这两者的关系是:HTML5作为主体,Jquery Mobile在HTML5的基础上对其进行了优化.装饰. HTML5 HTML5 ...

  5. jQuery Mobile 基础

    第一章 1.页面: <body> <div data-role="page"> <div data-role="header"&g ...

  6. jQuery Mobile基础

    1.安装 在<head></head>标签里边写入以下内容 jQuery Mobile CDN: <head> <meta charset="utf ...

  7. JAVA基础第四章-集合框架Collection篇

    业内经常说的一句话是不要重复造轮子,但是有时候,只有自己造一个轮子了,才会深刻明白什么样的轮子适合山路,什么样的轮子适合平地! 我将会持续更新java基础知识,欢迎关注. 往期章节: JAVA基础第一 ...

  8. JQuery制作网页—— 第四章JavaScript对象及初识面向对象

    1.对象:在JavaScript中,所有事物都是对象,如字符串.数值.数组.函数等. JavaScript中的基本数据类型: number(数值类型)   string(字符串类型)  boolean ...

  9. 好记心不如烂笔头之JQuery学习,第四章

    ---恢复内容开始--- JQuery中的事件和动画 JQuery中的事件: $(document).ready()该事件和JS中的window.load类似,但是window.load中需要等待所有 ...

随机推荐

  1. html checkbox 全选与反选

    之所以记录这个博客,是因为我完全用jquery,无法实现自己想要的结果(通过一个checkbox的选中或不选中控制其他多个checkbox状态) <input type="checkb ...

  2. swift项目中引入OC框架

  3. Iterator<转>

    Iterator就是迭代器的意思. Iterator是一个接口,利用迭代器主要是获取元素,很少删除元素.有三个方法:    1)hasNext():判断是否有更多的元素,如果有返回true.    2 ...

  4. 菜鸟写的第一个chrome插件

    一.新建一个文件夹,用来放插件的代码 二.首先新建配置文件manifest.json // 开发参考:http://open.chrome.360.cn/extension_dev/overview. ...

  5. Node.js 创建HTTP服务器(经过测试,这篇文章是靠谱的T_T)

    Node.js 创建HTTP服务器 如果我们使用PHP来编写后端的代码时,需要Apache 或者 Nginx 的HTTP 服务器,并配上 mod_php5 模块和php-cgi. 从这个角度看,整个& ...

  6. 用JSON-server模拟REST API(三) 进阶使用

    用JSON-server模拟REST API(三) 进阶使用 前面演示了如何安装并运行 json server , 和使用第三方库真实化模拟数据 , 下面将展开更多的配置项和数据操作. 目录: 配置项 ...

  7. WP8版微信5.4发布 新增夜间模式 暂没小视频

    经过近一个月的内测,WP8版的微信终于更新了v 5.4版本.新增聊天中的照片墙.识别图片二维码.夜间模式等功能,还对资源占用情况进行了优化,让程序可以更流畅的在低配置设备上运行. 不过,WP8版微信5 ...

  8. poj.1094.Sorting It All Out(topo)

    Sorting It All Out Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28762   Accepted: 99 ...

  9. CVPR2015文章下载

    http://www.cv-foundation.org/openaccess/content_cvpr_2015/html/Liu_Real-Time_Part-Based_Visual_2015_ ...

  10. BestCoder Round #60 1001

    Problem Description You are given a sequence of NNN integers. You should choose some numbers(at leas ...