[ Talk is Cheap Show me the CODE ] : jQuery Mobile页面布局
当我们专注地研究人类生活的空虚,并考虑荣华富贵空幻无常时,也许我们正在阿谀逢迎自己懒惰的天性。
Written In The Font
为了app的手机端,我选择了 jQuery Mobile ,学习中出一系列的博客吧.我喜欢的一句话 “Talk is Cheap Show me the CODE”,所以过多的废话 jjyy 我不太会,我直接上代码上样式.想玩手机端的可以来看下哦.
工具: Aptana Studio 3 + 火狐
学习内容:
创建单页布局
移动页面分:页眉,页脚和内容三部分.下面实现一个hello world(程序员的大门)页面:

show the code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hello World</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/jquery.mobile-1.3.2.css"> <script src="js/jquery.js"></script>
<script src="js/jquery.mobile-1.3.2.js"></script>
</head>
<body> <div id="page1" data-role="page" >
<div data-role="header"> <h1> 标题</h1></div>
<div data-role="content"> <h1> <a href="#">Hello World!!</a></h1></div>
<div data-role="footer"> <h1> 页脚</h1></div>
</div>
</body>
</html>
建多页布局
多页布局是单页布局的一个集合,创建一个Html文件包括很多个界面,也可以创建很多个html文件,每个文件包括一个页面爆他们连接起来.
这里我们用一个html方便进行.

show the code
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>测试</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/jquery.mobile-1.3.2.css"> <script src="js/jquery.js"></script>
<script src="js/jquery.mobile-1.3.2.js"></script> </head>
<body> <div id="page1" data-role="page" >
<div data-role="header"> <h1> 标题1</h1></div>
<div data-role="content"> <h1> <a href="#sub" data-role="button">跳转到页面二</a></h1></div>
<div data-role="footer"> <h1> 页脚1</h1></div>
</div> <div data-role="page2" id="sub">
<div data-role="header"> <h1> 标题2</h1></div>
<div data-role="content"> <h1> Hello World2!!</h1></div>
<div data-role="footer"> <h1> 页脚2</h1></div>
</div> </body>
</html>
data-role="button" 自动默认的button按钮样式
jQuery Mobile 中的按钮可通过三种方法创建[ 按钮会在下面 详细讲]:
- 使用 <button> 元素
- 使用 <input> 元素
- 使用 data-role="button" 的 <a> 元素
利用网格对齐内容
网格是用放置对象,使他们对齐的工具.
可使用的布局网格有四种:ui-grid-a ui-grid-b ui-grid-c ui-grid-d
可使用的内容类有四种:ui-block-a ui-block-b ui-block-c ui-block-d

show the code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>测试</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/jquery.mobile-1.3.2.css"> <script src="js/jquery.js"></script>
<script src="js/jquery.mobile-1.3.2.js"></script> </head>
<body> <div data-role="page" id="pageone">
<div data-role="header">
<h1>列</h1>
</div> <div data-role="content">
<h3>三列布局:</h3>
<div class="ui-grid-b">
<div class="ui-block-a" style="border: 1px solid black;"><span>1</span></div>
<div class="ui-block-b" style="border: 1px solid black;"><span>2</span></div>
<div class="ui-block-c" style="border: 1px solid black;"><span>3</span></div>
</div> <h3>多行的三列布局:</h3>
<div class="ui-grid-b">
<div class="ui-block-a" style="border: 1px solid black;"><span>9</span></div>
<div class="ui-block-b" style="border: 1px solid black;"><span>8</span></div>
<div class="ui-block-c" style="border: 1px solid black;"><span>7</span></div>
<div class="ui-block-a" style="border: 1px solid black;"><span>6</span></div>
<div class="ui-block-b" style="border: 1px solid black;"><span>5</span></div>
<div class="ui-block-a" style="border: 1px solid black;"><span>4</span></div>
</div>
</div>
</div> </body>
</html>
设计可折叠布局
可以通过点击或触摸来隐藏或显示可折叠的内容.

show the code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Jeff Li</title> <meta name="viewport" content="width=device-width, initial-scale=1"> <link rel="stylesheet" href="css/jquery.mobile-1.3.2.css"> <script src="js/jquery.js"></script>
<script src="js/jquery.mobile-1.3.2.js"></script> </head>
<body> <div data-role="page" id="subone">
<div data-role="header">
<h1>折叠案例</h1>
</div>
<div data-role="content">
<div data-role="collapsible">
<h3>点我... </h3>
<p>点了是sb</p>
</div> <div data-role="collapsible-set">
<div data-role="collapsible" data-collapsed="false">
<h3>再点我...</h3>
<p>I am a boy ...</p>
<p>u r a girl ......</p>
</div>
<div data-role="collapsible" >
<h3>没了...</h3>
<p>I am expanded on page load222...</p>
<div data-role="collapsible">
<h3>I am expanded on page load333</h3>
<p>I am expanded on page load333...</p>
</div>
</div>
</div> </div>
<div data-role="footer">
<h1>页脚</h1>
</div>
</div> </body>
</html>
Editor's Note
路漫漫其修远兮 我将上下而求索
[ Talk is Cheap Show me the CODE ] : jQuery Mobile页面布局的更多相关文章
- [ Talk is Cheap Show me the CODE ] : jQuery Mobile页面布
[ Talk is Cheap Show me the CODE ] : jQuery Mobile页面布局 当我们专注地研究人类生活的空虚,并考虑荣华富贵空幻无常时,或许我们正在阿谀逢迎自己懒惰的天 ...
- [ Talk is Cheap Show me the CODE ] : jQuery Mobile工具栏
[ Talk is Cheap Show me the CODE ] : jQuery Mobile工具栏 Written In The Font " Wirte less Do more& ...
- jQuery Mobile页面跳转切换的几种方式
jQuery Mobile在移动开发中越来越受到欢迎. 而他的各个版本号也在持续不断的更新中.相同的我也非常喜欢它,它加快了我们开发HTML5的速度. 同一时候又具备jQuery一样的操作方法. 学起 ...
- (二)Jquery Mobile介绍以及Jquery Mobile页面与对话框
Jquery Mobile介绍以及Jquery Mobile页面与对话框 一. Adobe Dreamweaver CS6 环境 最新版本的cs6会支持JM的使用,有自动提示功能,很强大.安装说明地 ...
- jQuery Mobile 页面事件
jQuery Mobile 页面事件 在 jQuery Mobile 中与页面打交道的事件被分为四类: Page Initialization - 在页面创建前,当页面创建时,以及在页面初始化之后 P ...
- 用谷歌浏览器Chrome浏览jQuery Mobile页面需要配置Tomcat服务器
在浏览jQuery Mobile 页面中,除了 Chrome浏览器出错外,其他的浏览器都ok: 这里,是因为需要单独配置 Tomcat 服务: 1.先配置java jdk: 2.下载,安装,配置,To ...
- 02.Jquery Mobile介绍以及Jquery Mobile页面与对话框
一.为什么要学Jquery Mobile JqueryMobile 是jquery的移动版本,懂基本的jquery知识,会简单的html+css就可以完成很多复杂的功能,还有就是这个框架在企业中用 ...
- JQuery Mobile 图片布局
JQuery Mobile 图片布局 1.实现效果
- jQuery mobile网格布局
3.4 内容格式化 jQuery Mobile中提供了许多非常有用的工具与组件,如多列的网格布局.折叠形的面板控制等,这些组件可以帮助开发者快速实现正文区域内容的格式化. 3.4.1 网格布局 jQu ...
随机推荐
- day 34
1 .内容回顾 #__author : 'liuyang' #date : 2019/4/17 0017 上午 9:01 # 利大于弊,则做之 # 会死于斯,则不去 # 2个 人 晚上 5个题 面试题 ...
- 【翻译】Flume 1.8.0 User Guide(用户指南) Sink
翻译自官网flume1.8用户指南,原文地址:Flume 1.8.0 User Guide 篇幅限制,分为以下5篇: [翻译]Flume 1.8.0 User Guide(用户指南) [翻译]Flum ...
- Hibernate中的实体规则、对象状态和进阶-一级缓存
一.hibernate中的实体规则 1.实体类创建的注意事项 2.主键类型 3.主键生成策略 (1)代理主键 (2)自然主键 二.hibernate中的对象状态 1.对象分为三种状态 2.三种状态的转 ...
- python模块:csv
""" csv.py - read/write/investigate CSV files """ import re from _csv ...
- 第44章:MongoDB-集群--Sharding(分片)--分片的片键选择
①片键选择的重要性 所谓片键,就是用来拆分数据的字段,通常为1-2个字段,由于片键一旦确定,并已经分片过后,基本上就不可能再修改片键了,因此初期设计和选择就非常重要了 ②片键规则 1:不可以是数组 2 ...
- spring mvc 扩展 标签解析
spring mvc 标签解析 InterceptorsBeanDefinitionParser http://www.cnblogs.com/fangjian0423/p/springMVC-int ...
- Vue route部分简单高级用法
一改变页面title的值 在开发时常常需要在切换到不同页面时改变浏览器的title值,那么我们就可以在定义路由的时候通过配置 meta 属性 来改变title值. import Vue from ...
- 微信机器人 index
<?phprequire_once ('src/wechat.php');$wechat = new wechat();$act = isset($_GET['act'])?$_GET['act ...
- ubuntu 16.04 安装 ssh
只要一条命令: sudo apt-get install openssh-server
- 背水一战 Windows 10 (116) - 后台任务: 前台程序激活后台任务
[源码下载] 背水一战 Windows 10 (116) - 后台任务: 前台程序激活后台任务 作者:webabcd 介绍背水一战 Windows 10 之 后台任务 前台程序激活后台任务 示例演示后 ...