随笔 - 63  文章 - 1  评论 - 8  阅读 - 39608

mui 子页面切换父页面底部导航

在父页面中新增方法:

function switchTab(tab){
plus.webview.hide(activeTab);
activeTab= tab;
plus.webview.show(tab);
var current = document.querySelector(".mui-bar-tab>.mui-tab-item.mui-active");
current.classList.remove('mui-active');
mui.each(mui(".mui-tab-item"),function(index,item){
if(item.href.indexOf(tab)>0)
{
item.classList.add('mui-active');
}
})
}

在子页面进行调用:

var w = plus.webview.getWebviewById("Hbuilder");
w.evalJS("switchTab('gonggao/gonggao_list.html')")

posted on   TopCoder.NET  阅读(670)  评论(0编辑  收藏  举报
努力加载评论中...
< 2025年4月 >
30 31 1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 1 2 3
4 5 6 7 8 9 10

点击右上角即可分享
微信分享提示