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开发技巧集萃 ...
随机推荐
- iOS开发-文件管理之多的是你不知道的事(一)
郝萌主倾心贡献.尊重作者的劳动成果,请勿转载. 假设文章对您有所帮助,欢迎给作者捐赠,支持郝萌主,捐赠数额任意,重在心意^_^ 我要捐赠: 点击捐赠 Cocos2d-X源代码下载:点我传送 游戏官方下 ...
- Android通过Intent.ACTION_CLOSE_SYSTEM_DIALOGS监听Home按键消息
Android对屏幕下方经常使用的四个按键消息处理是不一致的: 1.搜索按键的消息在onKeyDown或者onKeyUp中接收: 2.菜单按键的消息在onCreateOptionsMenu.onKey ...
- 一个登录页面的spring 逻辑过程
1.首先用户访问login.jsp 2.用户在登录页面输入用户名/密码,提交表单到服务器,Spring根据配置调用LoginController控制器响应登录请求(关键) 3.LoginControl ...
- SQLserver中用convert函数转换日期格式(1)
SQLserver中用convert函数转换日期格式2008-01-15 15:51SQLserver中用convert函数转换日期格式 SQL Server中文版的默认的日期字段datetime格式 ...
- HD-ACM算法专攻系列(21)——Wooden Sticks
题目描述: AC源码: 此题考查贪心算法,解题思路:首先使用快速排序,以w或l按升序排序(注意相等时,应按另一值升序排序),这样就将二维变量比较,变为了一维的,排好序的一边就不需要去管了,只需要对未排 ...
- Unity3D基础
鼠标事件: OnMouseEnter():鼠标进入 OnMouseExit():鼠标移出 OnMouseDown():鼠标点击 OnMouseUp():鼠标抬起 static GameObject I ...
- P2216 [HAOI2007]理想的正方形(二维RMQ)
题目描述 有一个a*b的整数组成的矩阵,现请你从中找出一个n*n的正方形区域,使得该区域所有数中的最大值和最小值的差最小. 输入输出格式 输入格式: 第一行为3个整数,分别表示a,b,n的值 第二行至 ...
- 用Latex做介绍自己和团队科研的网页
最近实验室师妹用网上的一些模板改了改做了几个网页.感觉还可以.但是实际上总觉得好像和韩家炜.周志华他们的页面差点什么. 最近找论文时发现奥地利的hornik老先生页面居然latex做的,然后找到了下面 ...
- nginx高级-前端必会
需要设置的几个参数: 基本配置文件 user www www; worker_processes auto; error_log /www/wwwlogs/nginx_error.log crit; ...
- 使用最新vue_cli+webpack搭建的模版
使用最新vue_cli+webpack搭建的模版,包含了常用的插件,router和axiox与测试插件.项目的结构如下: 框架下载地址:https://share.weiyun.com/5Cl7EbU