|
As to the data-load/data-unload properties. They have been removed. Use the events instead http://app-framework-software.intel.com/30/documentation.php#afui/afui_events
在jqmobi3.0中 我们去掉了data-load/data-unload 属性,如果想继续用 以前的 data-load/data-unload 可以复制一下代码放到您的程序中
They are renamed, and there is now "before" events too. If you liked the old way, you could always write a plugin to enable it.
- <code>//psuedo code
- var dispatchPanelEvent:function(fnc,myPanel){
- if (typeof fnc === "string" && window[fnc]) {
- return window[fnc](myPanel);
- }
- else if(fnc.indexOf(".")!==-1){
- var scope=window,items=fnc.split("."),len=items.length,i=0;
- for(i;i<len-1;i++){
- scope=scope[items[i]];
- if(scope===undefined) return;
- }
- return scope[items[i]](myPanel);
- }
- };
- $(document).on("panelload",function(e){
- var hasLoad=$(e.target).attr("data-load");
- return dispatchPanelEvent(hasLoad,e.target);
- })
- $(document).on("panelunload",function(e){
- var hasLoad=$(e.target).attr("data-unload");
- return dispatchPanelEvent(hasLoad,e.target);
- })</code>
复制代码
|
|