zoukankan      html  css  js  c++  java
  • mui 框架 引进子页面和预加载

    页面初始化 mui.plusReady(function(){ console.log("当前页面URL:"+plus.webview.currentWebview().getURL()); }); 2.在一个页面中 连接首页 与其他页面的跳转链接 用到加载(引入子页)和预加载 其中 a1 a2 a3 a4 为自己给各个子页面取的id名 其中 home con app 等为下面菜单对应的应用用来点击获取用

    mui.init({

    subpages:[//先加载首页
    {
    url:'home.html',
    id:'a1',
    styles:{
    top:'0px',
    bottom:'50px'
    }
    }

    ],
    preloadPages:[//缓存其他页面
    {
    url:'phone.html',
    id:'a2',
    styles:{
    top:'0px',
    bottom:'60px'
    }
    },
    {
    url:'app.html',
    id:'a3',
    styles:{
    top:'0px',
    bottom:'60px'
    }
    },
    {
    url:'mine.html',
    id:'a4',
    styles:{
    top:'0px',
    bottom:'60px'
    }
    }
    ]


    });
    mui.plusReady(function(){
    var con=plus.webview.getWebviewById("a2");
    var home=plus.webview.getWebviewById("a1");
    var app=plus.webview.getWebviewById("a3");
    var mine=plus.webview.getWebviewById("a4");
    document.getElementById("home").addEventListener('tap',function(){
    home.show();
    con.hide();
    app.hide();
    mine.hide();

    })
    document.getElementById('con').addEventListener('tap',function(){
    con.show();
    })
    document.getElementById('app').addEventListener('tap',function(){
    app.show();
    })
    document.getElementById('mine').addEventListener('tap',function(){
    mine.show();
    })
    })

  • 相关阅读:
    Git中使用.gitignore忽略文件的推送
    git stash详解
    Git撤销&回滚操作(git reset 和 get revert)
    git rebase和git merge的区别
    git撤销已经push到远程仓库上的代码
    Git Merge
    git cherry-pick 教程
    Failed to start LSB: Bring up/down错误解决方法
    linux centos7安装部署gitlab服务器
    CentOs7 HP找回root密码
  • 原文地址:https://www.cnblogs.com/yaomengli/p/6774356.html
Copyright © 2011-2022 走看看