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
随机推荐
- ios10 UNNtificationRequest UNUserNotificationCenter的应用 推送之本地推送
iOS10 已经 "deprected" 我们的UILocalNotification 采用了全新的UNUserNotificationCenter; 1 首先,你需要引进< ...
- iOS网络学习之“远离NSURLConnection 走进NSURLSession”
目前,在iOS的开发中,NURLConnection已经成为了过去式,现在的NSURLConnection已经deprected(iOS7之后),取而代之的是NSURLSession.而且AFNetw ...
- 小白死去活来的安装ros_qtc_plugin
在距离写上一篇有关ROS的文章已经过去了很久了.在这段时间内一直在积累,盼望着能够厚积薄发,但还是被无情的社会折磨的死去活来,深深的体会到了一般学校和重点学校找工作的差别,以及用人单位的区别对待.说到 ...
- 如何预览github中的html页面
在github里面的文件路径是https://github.com/gavin125/Sass-test/blob/master/html/index.html 那么我们需要在这个地址前面加上http ...
- linux下的/dev/shm目录
linux下的/dev/shm目录 linux中/dev目录下一般都是一些设备文件,例如磁盘.内存.摄像头等. /dev/shm这个目录是linux下一个利用内存虚拟出来的一个目录,这个目录中的文件都 ...
- tornado RequestHandler request.body & request.arguments
request.body , 请求的原始内容,post方式放在body中的. request.arguments, body参数和url参数的统一体, 同时也是经过“加工”,解码的. eg.在对接其他 ...
- 【Java POI】POI基于事件驱动解析大数据量2007版本Excel,空值导致列错位问题
1.目前测试了20M的文件,可以读取. 2.支持单个工作表1万+的数据行数,耗时如图. 3.以下是关键地方处理的代码 //Accepts objects needed while parsing. / ...
- discuz后台开发常用函数
showsetting()表单显示 返回值:无 参数: $setname - 指定输出标题,如:setting_basic_bbname, 自动匹配描述文字为:setting_basic_bbname ...
- ubuntu14.04 163sources.list
deb http://mirrors.163.com/ubuntu/ trusty main restricted universe multiverse deb http://mirrors.163 ...
- 常见概率组合题目总结quickstart
[本文链接] http://www.cnblogs.com/hellogiser/p/interview-questions-quickstart-for-combination-permutatio ...