jQuery Mobile 页面事件总结
一、页面初始化事件(Page initiallization) 在页面创建前,当页面创建时,以及在页面初始化之后。只在第一次加载时执行。
1. pagebeforecreate 页面创建前
[sourcecode language="plain"]
$(document).on("pagebeforecreate", function(){
console.log("执行pagebeforecreate");
});
[/sourcecode]
2. pagecreate页面创建时
[sourcecode language="plain"]
$(document).on("pagecreate",
function(){
console.log("执行pagecreate");
});
[/sourcecode]
3. pageinit 页面初始化之后
[sourcecode language="plain"]
$(document).on("pageinit",
function(){
console.log("执行pageinit");
});
[/sourcecode]
二、页面加载事件(Page Load/Unload) 当外部页面加载时、卸载时或加载失败时
- pagebeforeload
[sourcecode language="plain"]
$(document).on("pagebeforeload", function(event,
data){
console.log("执行pagebeforeload" +
data.url);
});
[/sourcecode]
2. pageload
[sourcecode language="plain"]
$(document).on("pageload", function(event, data){
console.log("执行pageload"
+ data.url);
});
[/sourcecode]
三、页面过渡事件(Page Transition) 在页面过渡之前和之后,每次过渡时都会触发。
- pagebeforeshow
[sourcecode language="plain"]
$(document).on("pagebeforeshow", "#index2",
function(){
console.log("index-pagebeforeshow");
});
[/sourcecode]
2. pageshow(常用)
[sourcecode language="plain"]
$(document).on("pageshow", "#index2",
function(){
console.log("index-pageshow");
});
[/sourcecode]
3. pagebeforehide
[sourcecode language="plain"]
$(document).on("pagebeforehide", "#index",
function(){
console.log("index-pagebeforehide");
});
[/sourcecode]
4. pagehide
[sourcecode language="plain"]
$(document).on("pagehide", "#index",
function(){
console.log("index-pagehide");
});
[/sourcecode]
页面index过渡到index2,执行顺序为:
a. 页面index的 pagebeforehide
b. 页面index2的pagebeforeshow
c. 页面index的 pagehide
d. 页面index2的 pageshow
注意:pageinit和pageshow的区别,
pageinit初始化一次,pageshow每次进入页面都会执行。
查看原文:http://www.haojianhua.com/2015/09/23/jquery-mobile-页面事件总结/
jQuery Mobile 页面事件总结的更多相关文章
- jQuery Mobile 页面事件
jQuery Mobile 页面事件 在 jQuery Mobile 中与页面打交道的事件被分为四类: Page Initialization - 在页面创建前,当页面创建时,以及在页面初始化之后 P ...
- jQuery Mobile页面跳转切换的几种方式
jQuery Mobile在移动开发中越来越受到欢迎. 而他的各个版本号也在持续不断的更新中.相同的我也非常喜欢它,它加快了我们开发HTML5的速度. 同一时候又具备jQuery一样的操作方法. 学起 ...
- [ Talk is Cheap Show me the CODE ] : jQuery Mobile页面布
[ Talk is Cheap Show me the CODE ] : jQuery Mobile页面布局 当我们专注地研究人类生活的空虚,并考虑荣华富贵空幻无常时,或许我们正在阿谀逢迎自己懒惰的天 ...
- (二)Jquery Mobile介绍以及Jquery Mobile页面与对话框
Jquery Mobile介绍以及Jquery Mobile页面与对话框 一. Adobe Dreamweaver CS6 环境 最新版本的cs6会支持JM的使用,有自动提示功能,很强大.安装说明地 ...
- 用谷歌浏览器Chrome浏览jQuery Mobile页面需要配置Tomcat服务器
在浏览jQuery Mobile 页面中,除了 Chrome浏览器出错外,其他的浏览器都ok: 这里,是因为需要单独配置 Tomcat 服务: 1.先配置java jdk: 2.下载,安装,配置,To ...
- 02.Jquery Mobile介绍以及Jquery Mobile页面与对话框
一.为什么要学Jquery Mobile JqueryMobile 是jquery的移动版本,懂基本的jquery知识,会简单的html+css就可以完成很多复杂的功能,还有就是这个框架在企业中用 ...
- jQuery Mobile页面返回无需重新get
最近公司的web app项目,使得我有幸一直接触和学习jQuery Mobile.这确实是一个很不错的移动开发库,有助于擅长web开发的工程师,快速入门并构建自己的移动应用.但是在前两天,我碰到了一个 ...
- jquery mobile Touch事件
Touch事件在用户触摸屏幕(页面)时触发 1.jquery mobile tap tap事件在用户敲击某个元素时触发 $("p").on("tap",fucn ...
- JQuery Mobile 页面参数传递
在单页模版中使用基于HTTP的方式通过POST和GET请求传递参数,而在多页模版中不需要与服务器进行通信,通常在多页模版中有以下三种方法来实现页面间的参数传递. 1.GET方式:在前一个页面生成参数并 ...
随机推荐
- 【Tech】YCSB-0.1.3安装使用
1. 下载YCSB 0.1.3: wget https://github.com/brianfrankcooper/YCSB/archive/0.1.3.tar.gz 如果提示“wget:命令没找到” ...
- Java WEB安全问题及解决方案
1.弱口令漏洞 解决方案:最好使用至少6位的数字.字母及特殊字符组合作为密码.数据库不要存储明文密码,应存储MD5加密后的密文,由于目前普通的MD5加密已经可以被破解,最好可以多重MD5加密. ...
- 利用SOLR搭建企业搜索平台 之——solr配置solrconfig.xml
来源:http://blog.csdn.net/zx13525079024/article/details/25310781 solrconfig.xml配置文件主要定义了SOLR的一些处理规则,包括 ...
- 《c程序设计语言》读书笔记--子函数原型和声明的形参
#include <stdio.h> #define Num 20 int power(int base,int n) { int p = 1; int i; for(i = 0;i &l ...
- msmq中消息的数量
using System.Diagnostics; PerformanceCounter objCounter = new PerformanceCounter("MSMQ Queue&qu ...
- 收藏一些python的小技能
例子1:For .. else 语法 foo=[2,1] for i in foo: if i == 0: break else: print("i was never 0") 例 ...
- gitflow workflow
https://www.atlassian.com/git/tutorials/comparing-workflows/forking-workflow Dream big, work smart, ...
- MVC简捷调用EasyUI的datagrid
一直想在项目中使用EasyUi的datagrid,但种种原因,没有实现. 这两天在开发一个项目中,愿望终于得以实现. 先看效果: 实现步骤是这样的: 1,在页面中画dataGrid,具体代码如下: & ...
- iOS中第三方框架刷新
0.先加入主头文件 #import "MJRefresh.h" 1.添加下拉刷新 MJRefreshHeaderView *header = [MJRefreshHeaderVie ...
- Linux kernel scriptes bin2c "\x"
/**************************************************************************** * Linux kernel scripte ...