jQuery 移动 ->页面生命周期? [英] jQuery Mobile -> Page Lifecycle?
问题描述
是否有类似 jQuery Mobile 页面的生命周期?像在 init、show、hide/back 或其他任何事件上触发的事件?!
Is there something like a lifecycle for jQuery Mobile pages? Like events that get fired on init, show, hide/back, or whatever events?!
提前致谢!
推荐答案
Intro
在这里找到的所有信息也可以在我的博客中找到 ARTICLE,您还可以找到工作示例.
Intro
All information found here can also be found in my blog ARTICLE, you will also find working examples.
事件 pagecreate
如果要动态添加页面内容并让 jQuery 的最佳事件移动风格的新内容.不要在ajax调用的情况下使用它,然后应该使用 pagebefore show 但所有动态添加的内容它们必须手动增强.
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
页面操作的最佳事件
事件 pageremove
事件 pagehide
事件 pageshow
唯一可以初始化和使用其他图形 jQuery/javascript 的事件,例如图形工具或轮播
Only event where other graphic jQuery/javascript can be initialized and used, like graph tools or carousels
其余的:
总是会触发两次所以跳过它
Will always trigger twice so skip it
事件 pagechange
总是会触发两次所以跳过它
Will always trigger twice so skip it
如果您想了解有关此主题的更多信息以及页面事件的整体工作方式,请查看我的其他文章.或者在此处找到它.只需搜索名为页面事件转换顺序的章节.但也可以随时随地阅读所有内容.
If you want to find more about this topic and how page events work overall take a look at my other ARTICLE. Or find it HERE. Just search for the chapter called Page events transition order. But also read everything anywhere.
官方文档:http://jquerymobile.com/demos/1.2.0/docs/api/events.html
这篇关于jQuery 移动 ->页面生命周期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!