PhoneGap中文网
标题:
jqmobi3.0中如果要使用data-load data-unload怎么用
[打印本页]
作者:
admin
时间:
2014-10-27 20:12
标题:
jqmobi3.0中如果要使用data-load data-unload怎么用
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>
复制代码
作者:
xpoqx
时间:
2014-10-28 13:52
本帖最后由 xpoqx 于 2014-10-28 13:55 编辑
3.0 都出了???
下载还是2.1?
作者:
admin
时间:
2014-10-28 20:33
xpoqx 发表于 2014-10-28 13:52
3.0 都出了???
临时下载地址
http://app-framework-software.intel.com/30/
作者:
yelingfeng521
时间:
2014-11-4 16:59
等正式版出了 再看看
作者:
ye987987
时间:
2014-12-14 00:57
这段放那里了 我放index 还是不行
作者:
qwee5465
时间:
2015-8-5 09:42
不行 报错, fnc is undefined
欢迎光临 PhoneGap中文网 (http://bbs.phonegap100.com/)
Powered by Discuz! X3.2