一、页面初始化事件(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) 当外部页面加载时、卸载时或加载失败时

  1. 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) 在页面过渡之前和之后,每次过渡时都会触发。

  1. 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 页面事件总结的更多相关文章

  1. jQuery Mobile 页面事件

    jQuery Mobile 页面事件 在 jQuery Mobile 中与页面打交道的事件被分为四类: Page Initialization - 在页面创建前,当页面创建时,以及在页面初始化之后 P ...

  2. jQuery Mobile页面跳转切换的几种方式

    jQuery Mobile在移动开发中越来越受到欢迎. 而他的各个版本号也在持续不断的更新中.相同的我也非常喜欢它,它加快了我们开发HTML5的速度. 同一时候又具备jQuery一样的操作方法. 学起 ...

  3. [ Talk is Cheap Show me the CODE ] : jQuery Mobile页面布

    [ Talk is Cheap Show me the CODE ] : jQuery Mobile页面布局 当我们专注地研究人类生活的空虚,并考虑荣华富贵空幻无常时,或许我们正在阿谀逢迎自己懒惰的天 ...

  4. (二)Jquery Mobile介绍以及Jquery Mobile页面与对话框

    Jquery Mobile介绍以及Jquery Mobile页面与对话框  一. Adobe Dreamweaver CS6 环境 最新版本的cs6会支持JM的使用,有自动提示功能,很强大.安装说明地 ...

  5. 用谷歌浏览器Chrome浏览jQuery Mobile页面需要配置Tomcat服务器

    在浏览jQuery Mobile 页面中,除了 Chrome浏览器出错外,其他的浏览器都ok: 这里,是因为需要单独配置 Tomcat 服务: 1.先配置java jdk: 2.下载,安装,配置,To ...

  6. 02.Jquery Mobile介绍以及Jquery Mobile页面与对话框

    一.为什么要学Jquery Mobile   JqueryMobile 是jquery的移动版本,懂基本的jquery知识,会简单的html+css就可以完成很多复杂的功能,还有就是这个框架在企业中用 ...

  7. jQuery Mobile页面返回无需重新get

    最近公司的web app项目,使得我有幸一直接触和学习jQuery Mobile.这确实是一个很不错的移动开发库,有助于擅长web开发的工程师,快速入门并构建自己的移动应用.但是在前两天,我碰到了一个 ...

  8. jquery mobile Touch事件

    Touch事件在用户触摸屏幕(页面)时触发 1.jquery mobile tap tap事件在用户敲击某个元素时触发 $("p").on("tap",fucn ...

  9. JQuery Mobile 页面参数传递

    在单页模版中使用基于HTTP的方式通过POST和GET请求传递参数,而在多页模版中不需要与服务器进行通信,通常在多页模版中有以下三种方法来实现页面间的参数传递. 1.GET方式:在前一个页面生成参数并 ...

随机推荐

  1. How to write a product backlog step by step

    一般来说,制定发布计划是在尝试回答这个问题:“最晚到什么时候为止,我们可以交付这个新系统的1.0版本“ 下面是验收标准规则的一个例子: 1.  所有重要性>=100的条目都必须在1.0版中发布. ...

  2. pyhton类集成

    class SchoolMember:   def __init__(self,name,age):     self.name = name     self.age = age     print ...

  3. Java编程思想(11~17)

    [注:此博客旨在从<Java编程思想>这本书的目录结构上来检验自己的Java基础知识,只为笔记之用] 第十一章 持有对象 11.1 泛型和类型安全的容器>eg: List<St ...

  4. BZOJ 1452 Count

    长知识啦..二维BIT. #include<iostream> #include<cstdio> #include<cstring> #include<alg ...

  5. HDU 1023 Train Problem II (卡特兰数,经典)

    题意: 给出一个数字n,假设火车从1~n的顺序分别进站,求有多少种出站序列. 思路: 卡特兰数的经典例子.n<101,用递推式解决.需要使用到大数.n=100时大概有200位以下. #inclu ...

  6. 【Java】从域名得到ip

    package sdfg; import java.net.InetAddress; //import java.net.UnknownHostException; import java.io.*; ...

  7. 【C#学习笔记】图片像素操作

    using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; usin ...

  8. Ensemble Learning 之 Gradient Boosting 与 GBDT

    之前一篇写了关于基于权重的 Boosting 方法 Adaboost,本文主要讲述 Boosting 的另一种形式 Gradient Boosting ,在 Adaboost 中样本权重随着分类正确与 ...

  9. javamail模拟邮箱功能发送电子邮件-中级实战篇【新增附件发送方法】(javamail API电子邮件实例)

    引言: JavaMail jar包下载地址:http://java.sun.com/products/javamail/downloads/index.html 此篇是紧随上篇文章而封装出来的,阅读本 ...

  10. 【转】session setup failed: NT_STATUS_LOGON_FAILURE -- 不错

    原文网址:http://blog.sina.com.cn/s/blog_5cdb72780100l26f.html samba服务器出现“session setup failed: NT_STATUS ...