jQuery Moblie 学习之page、button、theme、panel、listview、controlgroup、navbar等(一)
1.jQTouch
jQTouch与jQuery Moblie十分相似,也是一个jQuery插件,同样也支持HTML页面标签驱动,实现移动设备视图切换效果。不同的是它是专为WebKit内核的浏览器打造的,可以借助该浏览器的专有功能对页面进行渲染;此外,开发时所需的代码量更少。如果开发的项目中,目标用户群都使用WebKit内核的浏览器,可以考虑此框架。
2.Sencha Touch
Sencha Touch是一套基于ExtJS开发的插件库。也是针对于WebKit内核的浏览器打造的,不同的是它的开发语言不是基于HTML标签,而是类似于客户端的MVC风格编写的JS代码,相对来说,学习周期较长。
看代码:
_Layout.cshtml
<!DOCTYPE html>
<html lang="zh">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta charset="utf-8" />
<title>@ViewBag.Title</title>
<meta name="viewport" content="width=device-width, initial-scale=1">@*网站页面的自适应,宽度为驱动设备的宽度*@
<link href="~/favicon.ico" rel="shortcut icon" type="image/x-icon" />
@Styles.Render("~/Content/mobileCss", "~/Content/css")@*<link href="~/Content/jquery.mobile-1.4.2.css" rel="stylesheet" />*@
@Scripts.Render("~/bundles/modernizr")@*<script src="~/Scripts/modernizr-2.6.2.js"></script>*@
@*modernizr就是为HTML5而生的——它是一个检测浏览器对HTML5和CSS3特性支持的JS库,通过检测你的浏览器对html5/css3的支持情况,返回特定的样式名称,从而可以针对不同的浏览器写出不同的样式。*@
</head>
<body>
@RenderBody()
@Scripts.Render("~/bundles/jquery")@*<script src="~/Scripts/jquery-1.8.2.js"></script>*@
<script> //该事件在ready()之前执行,因为mobileinit事件是在加载后马上触发,所以你需要在Jquery Mobile加载之前绑定你的事件处理函数,
//必须放在jQuery和jQuery Moblie之间
$(document).on("mobileinit", function () {
$.mobile.ajaxEnabled = true;
});
</script>
@Scripts.Render("~/bundles/jquerymobile")@*<script src="~/Scripts/jquery.mobile-1.4.2.js"></script>*@
@RenderSection("scripts", required: false)
</body>
</html>
Index.cshtml
<section data-role="page" id="foo">
<header data-role="header" data-theme="b" data-position="fixed" data-fullscreen="true">
@*data-position="fixed" 让头部和尾部固定在浏览器顶部
data-fullscreen="true" 不占位
*@
<h1>Page Title</h1>
</header>
<div role="main" class="ui-content">
<p>Page content goes here.</p>
<p><a href="#bar" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-notext ui-icon-delete ui-btn-inline" data-transition="slide">go to bar</a>@*跳转到id=”bar“页面*@
<a href="#bar" class="ui-btn ui-shadow ui-corner-all ui-btn-icon-notext ui-icon-delete ui-btn-inline" data-transition="slide">go to bar</a> <a href="#bar" class="ui-btn ui-shadow ui-corner-all ui-icon-delete ui-btn-inline ui-btn-icon-left" data-transition="slide" data-mini="true">go to bar</a>
</p>
@* ui-btn :按钮样式
ui-shadow:按钮加上阴影
ui-corner-all:按钮圆角
data-transition="slide": 跳转的页面效果
ui-btn-icon-notext 让按钮没有文字
ui-icon-delete 出现删除的图片
ui-btn-inline 行内不占一行
ui-btn-icon-left 让图标出现在文字的左边
*@ <div data-role="controlgroup" data-mini="true" data-type="horizontal">
<a href="#" class="ui-btn ui-corner-all">no icon</a>
<a href="#" class="ui-btn ui-corner-all ui-icon-delete ui-btn-icon-left">left</a>
<a href="#" class="ui-btn ui-corner-all ui-icon-delete ui-btn-icon-right">right</a>
</div>
@* data-role="controlgroup" 控件组
data-type="horizontal" 控件排列方式
*@
<a href="#leftpanel3" class="ui-btn ui-shadow ui-corner-all ui-btn-inline ui-btn-mini">Overlay panel</a> <div data-role="collapsible">
<h4>Heading</h4>
<p>I'm the collapsible content.By default I'm closed,but you can click the header to open me.</p>
</div> <ul data-role="listview" data-filter="true" data-filter-placeholder="请输入" data-inset="true">
<li>
<a href="#">Acura</a>
</li>
<li><a href="#">Audi</a></li>
<li><a href="#">BMW</a></li>
<li><a href="#">Cadillac</a></li>
<li><a href="#">Ferrari</a></li>
</ul> <div> </div>
</div>
<footer data-role="footer" data-theme="c" data-position="fixed">
<div data-role="navbar" data-iconpos="left">
<ul>
<li><a href="#" class="ui-btn-active" data-icon="home">One</a></li>
<li><a href="#" data-icon="gear">two</a></li>
<li><a href="#" data-icon="back">Three</a></li>
</ul>
</div>
@*
data-role="navbar" 导航
data-iconpos="left" 所有的导航图标都向左
*@
</footer> <div data-role="panel" id="leftpanel3" data-position="left" data-display="overlay" data-theme="a"> <h3>Left Panel: Overlay</h3>
<p>This panel is positioned on the left with the overlay display mode. The panel markup is <em>after</em> the header, content and footer in the source order.</p>
<p>To close, click off the panel, swipe left or right, hit the Esc key, or use the button below:</p>
<a href="#demo-links" data-rel="close" class="ui-btn ui-shadow ui-corner-all ui-btn-a ui-icon-delete ui-btn-icon-left ui-btn-inline">Close panel</a> </div><!-- /leftpanel3 --> </section> <!-- Start of second page -->
<section data-role="page" id="bar"> <header data-role="header">
<h1>Bar</h1>
</header>
<!-- /header --> <div role="main" class="ui-content">
<p>I'm the second in the source order so I'm hidden when the page loads. I'm just shown if a link that references my id is beeing clicked.</p>
<p><a href="#foo" >Back to foo</a></p>@*跳转到id=”foo“页面*@ <p><a href="#" data-rel="back" >Back to foo</a></p>@*跳转到id=”foo“页面*@ </div>
<!-- /content --> <footer data-role="footer">
<h4>Page Footer</h4>
</footer>
<!-- /footer -->
</section>
<!-- /page -->
jQuery Moblie 学习之page、button、theme、panel、listview、controlgroup、navbar等(一)的更多相关文章
- 【jQuery UI 1.8 The User Interface Library for jQuery】.学习笔记.10.Button 和 Autocomplete控件
Button ,可以使用 <button> <input> <a>. <input> 中的不同类型,submit , radio , checkbox ...
- JQuery基础学习总结
JQuery基础学习总结 简单总结下JQuery: 一:事件 1.change事件 <!DOCTYPE html> <html lang="en"> < ...
- Jquery moblie中的分栏布局
大家好,很高兴又与大家见面了,今天我要给大家展示的是自己对jquery moblie中网格布局的理解.可能不是尽善尽美,希望大家多多体谅! 在jquery moblie中有两种布局,一种是表格布局( ...
- Jquery重新学习之七[Ajax运用总结A]
Jquery中Ajax的运用是另外一个重点,平时项目经常会用它进行一些异步操作:其核心是通过XMLHttpRequest对象以一种异步的方式,向服务器发送数据请求,并通过该对象接收请求返回的数据,从而 ...
- jQuery框架学习第十一天:实战jQuery表单验证及jQuery自动完成提示插件
jQuery框架学习第一天:开始认识jQueryjQuery框架学习第二天:jQuery中万能的选择器jQuery框架学习第三天:如何管理jQuery包装集 jQuery框架学习第四天:使用jQuer ...
- jQuery 顺便学习下CSS选择器 奇偶匹配nth-child(even)
今天学习jQuery,看到nth-child(even)用法,特意找了下这个选择器的用法,在CSS3标准中,用法很强大. 对此,我把CSS3标准中nth-child()用法大致介绍下: CSS3伪类选 ...
- Jquery插件学习
前端开发也工作了一段时间,Jquery代码页写了很多,但是都是些的很零散的,不是很好用,网上看了很多人写的Jquery 很好用,而且到每个项目中都可以使用, 本人就感觉很好奇他们是怎么做到的呢,于是自 ...
- jQuery Lint: enables you to automatically inject jQuery Lint into the page as it is loaded (great for ad-hoc code validation)
FireQuery is a Firebug extension for jQuery development jQuery Lint: enables you to automatically in ...
- jQuery Mobile 学习
jQuery Mobile 学习系列 http://blog.csdn.net/bao990423420/article/details/13995021
随机推荐
- 符瑞艺 160809228_C语言程序设计实验2 选择结构程序设计
实验2- 输入3个数,并按由大到小的顺序输出. 实验要求: 编写一个C程序,输入3个数,并按由大到小的顺序输出. 参考: 源码: #include <stdio.h> int main() ...
- Android使用Unity导致Activity被销毁的解决办法
由于需要在Android中使用Unity(Android的Activity会继承Unity提供的UnityPlayerActivity),可能是第三方的原因退出Unity后就导致Android整个应用 ...
- Qt 官方一键动态发布技能
苦找了好几天动态库,程序可以运行了,结果没有图标还是少了运行库很苦恼,发现Qt 官方有一键动态发布功能感觉自己萌萌的,来自qt吧亲测可用. 集成开发环境 QtCreator 目前生成图形界面程序 ex ...
- python suds 一坑
当被调用服务的返回xml内容值不是按照wsdl文件描述定义的, 就莫名奇妙返回suds.WebFault 没有更多详细信息! 于是将源码解压,并插入到sys.path[0], 通过设置断点的方式找出非 ...
- [mysql]max_allowed_packet ,centos
在通过脚本向mysql写入大量测试数据时,出现这个问题,记录下: https://dev.mysql.com/doc/refman/5.5/en/packet-too-large.html 修改/et ...
- redis配置文件redis.conf参数说明
redis配置文件redis.conf参数说明 (2013-01-09 21:20:40)转载▼ 标签: redis配置 redis.conf 配置说明 杂谈 分类: nosql # By defau ...
- Binary Tree Non-recursive Traversal
Preorder: public static void BSTPreorderTraverse(Node node) { if (node == null) { return; } Stack< ...
- bccomp比较大小注意
2015年12月15日 14:18:56 星期二 echo bccomp('1', '1.01', 2); // -1 echo bccomp('1', '1.01', 3); // -1 echo ...
- SELinux的关闭与开启
SELinux是美国国家安全局对于强制访问控制的实现,是NSA在Linux社区的帮助下开发的一种访问控制体系,所以SELinux可以看做是安全强化的Linux子系统,和防火墙有相似点,作用之一是保证计 ...
- 【hiho一下第77周】递归-减而治之 (MS面试题:Koch Snowflake)
本题是一道微软面试题,看起来复杂,解出来会发现其实是一个很简单的递归问题,但是这道题的递归思路是很值得我们反复推敲的. 原题为hihocoder第77周的题目. 描述 Koch Snowflake i ...