jQuery Mobile(jqm)button的隐藏和显示,包含a标签,圆角和非圆角button
在移动互联网时代,HTML5开发越来越收到欢迎。
于是各种HTML5的框架都出来了。因为对于jquery的熟悉,jquery mobile 为多数人选择学习的对象。我也是众多追求者之中的一个。近期一直在开发jQuery Mobile的相关应用。
并颇有心得。再这里和大家一起分享一下。
好了,我们之间上代码:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>如有不懂。请加qq群:135430763,共同学习! </title> <meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
<meta http-equiv="description" content="this is my page">
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> <!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
<link rel="stylesheet" href="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.css">
<script src="http://code.jquery.com/jquery-1.8.3.min.js"></script>
<script src="http://code.jquery.com/mobile/1.3.2/jquery.mobile-1.3.2.min.js"></script>
</head> <body>
<div data-role="page" id="page" data-theme="b">
<div data-role="header" data-position="fixed" data-theme="b">
<h1>
如有不懂,请加qq群:135430763。共同学习! </h1>
<a href="javascript:location.reload();" data-role="button" class="ui-btn-right" data-icon="refresh">刷新</a>
</div> <div data-role="content">
<p>
点击button2。隐藏button1。而且将button2改为圆角
</p><p>
点击button3。显示button1,而且将button2改为非圆角
</p>
<p>
如有不懂,请加qq群:135430763。共同学习! </p>
<p>
如有不懂,请加qq群:135430763,共同学习。
</p>
<p>
如有不懂。请加qq群:135430763,共同学习!
</p>
<p>
如有不懂,请加qq群:135430763,共同学习! </p> <div data-role="controlgroup" data-type="horizontal">
<input type="button" value="我是button1" data-inline="true" id="btn1">
<input type="button" value="我是button2" data-inline="true" id="btn2">
<input type="button" value="我是button3" data-inline="true" id="btn3">
</div> <p>
点击button5,隐藏button4。而且将button5改为圆角
</p>
<p>
点击button6,显示button4,而且将button5改为非圆角
</p> <div data-role="controlgroup" data-type="horizontal">
<a href="#" data-role="button" id="a4">我是button4</a>
<a href="#" data-role="button" id="a5" onclick="hideA();return false;">我是button5</a>
<a href="#" data-role="button" id="a6" onclick="showA();return false;">我是button6</a>
</div>
</div> <div data-role="footer" data-position="fixed" data-theme="b">
<span style="height: 40px; line-height: 40px; text-align: center; display: block; font-size: 9px;">如有不懂,请加qq群:135430763,共同学习!</span>
</div>
</div>
<script type="text/javascript">
//给button2绑定click事件
$('#btn2').unbind().bind('click',function(){
//隐藏button1
$('#btn1').parent("div").css('display','none');
//给button2加入样式,使button2变成圆角
$('#btn2').parent("div").addClass('ui-first-child');
});
//给button3绑定click事件
$('#btn3').unbind().bind('click',function(){
//隐藏button1
$('#btn1').parent("div").css('display','');
//给button2减去ui-first-child样式
$('#btn2').parent("div").removeClass('ui-first-child');
}); //a5标签的onclick事件
function hideA(){
$('#a4').css('display','none');
//给a5标签加入样式,使a5标签变成圆角
$('#a5').addClass('ui-first-child');
} //a6标签的onclick事件
function showA(){
$('#a4').css('display','');
//给a5标签删除样式,使a5标签变成非圆角
$('#a5').removeClass('ui-first-child');
} </script> </body>
</html>
在看看执行效果:
更具体的学习资料,请点击下载:http://download.csdn.net/download/xmt1139057136/7447463
欢迎大家关注我的个人博客,如有不懂,请加qq群:135430763进行共同学习!
jQuery Mobile(jqm)button的隐藏和显示,包含a标签,圆角和非圆角button的更多相关文章
- jquery mobile 请求数据方法执行时显示加载中提示框
在jquery mobile开发中,经常需要调用ajax方法,异步获取数据,如果异步获取数据方法由于网速等等的原因,会有一个反应时间,如果能在点击按钮后数据处理期间,给一个正在加载的提示,客户体验会更 ...
- jquery动画(控制动画隐藏、显示时间轴)
<!DOCTYPE html><html> <head> <meta http-equiv="Content-type" conte ...
- jQuery Mobile学习之grid、等待显示的ajax效果、页面跳转、页面跳转传递参数等(二)
Index.cshtml <!-- Start of second page --> <section data-role="page" id="bar ...
- jQuery关于复制(复制隐藏文字+显示文字)跳转,Clipboard
html: (直接上扎实的数据,框子自己搭建) <script type="text/javascript" src="../../js/jquery.min.js ...
- jQuery 学习02——效果:隐藏/显示、淡入淡出、滑动、动画、停止动画、Callback、链
jQuery 效果- 隐藏hide()和显示show() 语法: $(selector).hide(speed,callback);$(selector).show(speed,callback); ...
- jquery的隐藏与显示
###显示与隐藏,通过用hide()和show()函数来实现 语法: $(selector).hide(speed,callback); $(selector).show(speed,callback ...
- jquery mobile将页面内容当成弹框进行显示
注:必须使用相对应版本的jquery mobile css.不然无法正常显示 <div data-role="page" id="pageone"> ...
- 经典收藏 50个jQuery Mobile开发技巧集萃
http://www.cnblogs.com/chu888chu888/archive/2011/11/10/2244181.html 1.Backbone移动实例 这是在Safari中运行的一款Ba ...
- (转)经典收藏 50个jQuery Mobile开发技巧集萃
(原)http://www.cnblogs.com/chu888chu888/archive/2011/11/10/2244181.html 经典收藏 50个jQuery Mobile开发技巧集萃 ...
随机推荐
- 在SAE上使用Ueditor的图片上传功能
SAE上是没有文件夹读写权限的,所以要在SAE使用Ueditor的图片上传功能须要借助SAE的Storage服务. 一.开通Storage服务 在SAE控制台开通Storage服务,并新增一个doma ...
- QT使用tableWidget显示双排列表 而且选中用红框圈出来
如需转载请标明出处:http://blog.csdn.net/itas109 整个project下载地址:http://download.csdn.net/detail/itas109/7607735 ...
- Cocos2d-x3.0 RenderTexture(三)
.h #include "cocos2d.h" #include "cocos-ext.h" #include "ui/CocosGUI.h" ...
- UVA - 11762 - Race to 1 记忆化概率
Dilu have learned a new thing about integers, which is - any positive integer greater than 1 can bed ...
- c8---递归
// // main.c // 递归函数 // // Created by xiaomage on 15/6/7. // Copyright (c) 2015年 xiaomage. All right ...
- 英语发音规则---T字母
英语发音规则---T字母 一.总结 一句话总结: 1.T一般发[t]? ten [ten] num.十 letter [ˈletə(r)] n.信; 证书 meet [mi:t] vt.& v ...
- Oracle 11G R2 RAC中的scan ip 的用途和基本原理
Oracle 11G R2 RAC增加了scan ip功能,在11.2之前,client链接数据库的时候要用vip,假如你的cluster有4个节点,那么客户端的tnsnames.ora中就对应有四个 ...
- (转)Django学习之 第三章:动态Web页面基础
上一章我们解释了怎样开始一个Django项目和运行Django服务器 当然了,这个站点实际上什么也没有做------除了显示了"It worked"这条信息以外. 这一章我们介绍怎 ...
- android 打包工具
sdk.jar-修改路径-JarToDex-DexToSmali-复制文件
- 利用Windows2003 IP安全策略实现服务器远程桌面端口(3389)访问控制
1 开始 → 运行 → 对话框中输入gpedit.msc → 确定 2 打开“组策略编辑器” 计算机配置 → Windows配置 → 右键点击“IP安全策略,在 本地计算机” →选择“创建IP安全策略 ...