javascript - jQuery Mobile -> 页面生命周期?

标签 javascript jquery jquery-mobile page-lifecycle

是否有类似 jQuery Mobile 页面生命周期的东西?比如在初始化、显示、隐藏/返回或任何事件时触发的事件?!

提前致谢!

最佳答案

介绍

在这里找到的所有信息也可以在我的博客中找到 ARTICLE ,您还会找到工作示例。

在页面转换期间:

事件 pagebeforecreate

事件 pagecreate

Best event if you want to dynamically add page content and let jQuery Mobile style yout new content. Don't use it in case of ajax call, pagebefore show should be used then but all dynamically added content them must be manually enhanced.

事件 pageinit

It will only trigger once per page load, any return to the page will not trigger it again, unless page is manually refreshed

事件 pagebeforehide

事件 pagebeforeshow

Best event for the page manipulation

事件 pageremove

事件 pagehide

事件 pageshow

Only event where other graphic jQuery/javascript can be initialized and used, like graph tools or carousels

其余的:

事件 pagebeforechange

Will always trigger twice so skip it

事件 pagechange

Will always trigger twice so skip it

如果您想了解有关此主题的更多信息以及页面事件的整体工作原理,请查看我的其他 ARTICLE 。或者找 HERE 。只需搜索名为 Page events transition order 的章节即可。但也可以随时随地阅读所有内容。

官方文档:http://jquerymobile.com/demos/1.2.0/docs/api/events.html

关于javascript - jQuery Mobile -> 页面生命周期?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15232532/

相关文章:

css - jQuery Mobile li 元素中右侧的图像

javascript - 为什么 ECMA 脚本不提供开箱即用的整数类型?

javascript - 在JS中动态改变表单的值

javascript - react native View 渲染

javascript - 单页javascript应用——页面和页面转换管理

html - 滑动动画以配合手势

javascript - AngularJS概念理解

javascript - 单个页面上的多个倒计时

php - JQuery + Json - 第一步示例

jquery - chrome 自动完成中断样式选择