dcloudio / dcloudio/mui

tab bar的选项卡模式和侧滑menu菜单

Open
#50 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
13.5k
Forks
6.5k
PR merge metrics
No merged PRs in 30d

Description

(说明:以前用的appcan,所以header代表头,content代表中间,footer代表底部)
index.html中
//1.创建四个content
mui.plusReady(function() {
main = plus.webview.currentWebview();
for(var i=0; i<4; i++) {
var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);
if(i == 0) {
main.append(sub);//这里我取消了隐藏后三个webview的操作,因为看到html5plus的API中说明了“创建完成后需要调用show方法才能将Webview窗口显示出来”,这里原本是因为四个content页面中没有写keyEventBind{backbutton: false},点击返回按键时先执行刚才的webview.hide操作。
}
}
}
//2.footer点击事件
mui('.mui-bar-tab').on('tap', 'a', function(e) {
var targetTab = this.getAttribute('href');
if (targetTab == activeTab) {
return;
}
title.innerHTML = this.querySelector('.mui-tab-label').innerHTML;
plus.webview.show(targetTab);
main.append(targetTab);
plus.webview.hide(activeTab);
activeTab = targetTab;
});
//3.安卓返回按键
var first = null;
mui.back = function() {
if (showMenu) {
closeMenu();
}
else {
//首次按键,提示‘再按一次退出应用’
if (!first) {
first = new Date().getTime();
mui.toast('再按一次退出应用');
setTimeout(function() {
first = null;
}, 1000);
} else {
if (new Date().getTime() - first < 1000) {
plus.runtime.quit();
}
}
}
}
点击footer中第一个tab-item然后执行openMenu,header和content正常挪动,点击其他tab-item,执行openMenu后,只有header正常挪动,content不动,覆盖了menu,在整个过程中,footer始终在页面底部不动。

请问怎么样让其他content也正常挪动,底部也正常挪动?

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.