jQuery mobile dialog 详情
来源:互联网 发布:软件开发需要学习什么 编辑:程序博客网 时间:2024/04/29 17:47
//连接的方式打开对话框 这个比较简单<a href="dialog.html" class="ui-btn mybtn" data-transition="pop">连接打开对话框</a>//js的方式打开对话框 这个也不是很复杂 <a href="#" class="ui-btn mybtn opendialogByjs" data-transition="pop">JS打开对话</a>//绑定函数 页面 pageshow的时候$( "#dialogPage" ).on( "pagecreate", function( event ) { }).on("pageshow",function(){ var page = $(this); //这里一定要记得unbind("click") 要不然一个页面可能会绑定多次 page.find(".opendialogByjs").unbind("click").on("click",function(){ //加一个隐藏的a标签 a标签的href指向dialog.html $('#dialogPage').append("<a id='tPushDialog' href='dialog.html' data-rel=\"dialog\" style='display:none;'>Open dialog</a> "); // 触发a标签的click事件 $("#tPushDialog").trigger('click'); });});
dialog.html---><div data-role="page" data-dialog="true" id="dialogpage"> <div data-role="header" data-theme="b"> <h1>Dialog</h1> </div> <div role="main" class="ui-content"> <h1>标题</h1> <p>弹出页内容<code>data-rel="dialog"</code> attribute.</p> <a href="index.html" data-rel="back" class="ui-btn ui-shadow ui-corner-all ui-btn-a">确定</a> <a href="index.html" data-rel="back" class="ui-btn ui-shadow ui-corner-all ui-btn-a">取消</a> </div></div>//对话框可以动态关闭的 这是官方提供的方法 其实看源码就知道它的功能只是退回 也就是返回上一页$("#dialogpage").dialog("close");//dialog的声明周期与其他页面的生命周期一样pagebeforeload-pagebeforecreate-pagecreate-pageinit等 不再列举
1 0
- jQuery mobile dialog 详情
- Jquery Mobile dialog的生命周期
- Jquery Mobile dialog的生命周期
- jquery mobile用代码弹出dialog
- android dialog使用详情
- jQuery Mobile中对话框dialog的data-*选项
- jQuery Mobile
- jQuery Mobile
- JQUERY MOBILE
- jQuery Mobile
- jquery mobile
- jQuery Mobile
- jQuery Mobile
- jquery mobile
- jQuery Mobile
- jQuery Mobile
- JQuery Mobile
- jquery mobile
- 彻底理解Java动态代理
- @po附近有语法错误
- mysql中group by 和 group_concat()的区别
- facet与compiler不匹配
- 大数据下的用户行为分析
- jQuery mobile dialog 详情
- java 工具类(将数据导入数据库)
- redis学习笔记五之基础命令—有序集合
- 判断鼠标移动方向
- Mongodb有什么优势?相对关系型数据库如MySQL
- 数据库见表表名长度限制
- QT项目转成vs项目
- 解决NDK开发中的 Method 'NewStringUTF' could not be resolved
- gprof工具使用