手機實現窗體切換
1、在5+環境下(即H5app)
先初始化:
mui.init({ subpages:[{ url:"page1.html",//子頁面HTML地址,支持本地地址和網絡地址 id:"subpage1",//子頁面標志 styles:{ top:40,//子頁面頂部位置 /*bottom:subpage-bottom-position,//子頁面底部位置 width:subpage-width,//子頁面寬度,默認為100% height:subpage-height,//子頁面高度,默認為100% ......*/ } },{ /*page2*/ } }] });
再通過點擊切換
all.addEventListener("tap",function(){ console.log(plus.webview.currentWebview()); plus.webview.getWebviewById("subpage2").show(); })
2、在非5+條件(微信瀏覽器、手機瀏覽器)
plus代碼不執行!!!