appframework3.0(JQmobi)入门教程

appframework3.0好像是3月24日发布的,今天31号,发现和之前的appframework2.1 || 2.2并不同。

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.

//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);
})


结构:


id="mainview" 肯定是 app页面的主视图。

id="splashscreen" 是加载页面过渡的代码块。


在id="mainview" 中,直接header 和 footer 应该是默认的公共顶部和底部。nav是左右导航,id=left做导航,id=right是右导航。

左右导航中还包含header和footer,可以以class=pages再分多个页面。

data-include="“包含一个子页面。

data-left-drawer="left" 声明左导航。

class="panel"声明一个画面。

data-title="Main"是当前画面顶部标题。如果没有可能会继承上一级的header。

data-selected="true" 默认选中这个画面。

 data-tab="navbar_ui" 选中的id=navbar_ui的ID。

 data-footer="footerui"自定义底部导航。

title=""也是标题,出现在顶部,不知道和data-title="Main"区别。


data-menu-close 关闭左右导航。

data-menu-close data-right-menu="right" 关闭又侧导航。

οnclick="$.afui.drawer.hide('#left')" 关闭id=left的导航。

$.afui.drawer.show('#right','right','push')打开右导航像推动效果。

data-transition="slide" 转场效果为slide


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值