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.


  1. <code>//psuedo code
  2. var dispatchPanelEvent:function(fnc,myPanel){
  3.     if (typeof fnc === "string" && window[fnc]) {
  4.         return window[fnc](myPanel);
  5.     }
  6.     else if(fnc.indexOf(".")!==-1){
  7.         var scope=window,items=fnc.split("."),len=items.length,i=0;
  8.         for(i;i<len-1;i++){
  9.             scope=scope[items[i]];
  10.             if(scope===undefined) return;
  11.         }
  12.         return scope[items[i]](myPanel);
  13.     }
  14. };
  15. $(document).on("panelload",function(e){
  16.    var hasLoad=$(e.target).attr("data-load");

  17.    return dispatchPanelEvent(hasLoad,e.target);
  18. })

  19. $(document).on("panelunload",function(e){
  20.    var hasLoad=$(e.target).attr("data-unload");

  21.    return dispatchPanelEvent(hasLoad,e.target);
  22. })</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