父webview中预加载的popover弹出菜单 ,当子页面显示后,父页面会被覆盖掉
代码如下:
mui.init();
mui.plusReady(function() {
mui.preload({
id: 'menu',
url: 'menu.html',
show: {
autoShow: true
}
});
});
document.getElementById('classMenu').addEventListener('tap', function() {
plus.webview.getWebviewById('menu').evalJS('mui("#topPopover").popover("toggle")');
plus.webview.currentWebview().append(plus.webview.getWebviewById('menu'));
});
子页面
mui.init();
html,
body {
background-color: #efeff4;
}
/*header.mui-bar {
display: none;
}*/
.mui-content {
padding: 10px;
}
/*跨webview需要手动指定位置*/
#topPopover {
position: fixed;
top: 16px;
right: 6px;
}
#topPopover .mui-popover-arrow {
left: auto;
right: 6px;
}
#actionSheet .mui-table-view {
border-radius: 4px;
}
#actionSheet .mui-table-view-cell {
padding: 15px;
text-align: center;
}
#actionSheet .mui-table-view .mui-table-view-cell:first-child,
#actionSheet .mui-table-view .mui-table-view-cell:first-child>a:not(.mui-btn) {
border-top-right-radius: 4px;
border-top-left-radius: 4px;
}
#actionSheet .mui-table-view .mui-table-view-cell:last-child,
#actionSheet .mui-table-view .mui-table-view-cell:last-child>a:not(.mui-btn) {
border-bottom-right-radius: 4px;
border-bottom-left-radius: 4px;
}
.mui-backdrop-action.mui-backdrop {
bottom: 0;
}
p {
text-indent: 22px;
}
span.mui-icon {
font-size: 14px;
color: #007aff;
margin-left: -15px;
padding-right: 10px;
}
.mui-popover {
height: 300px;
}
mui('.mui-scroll-wrapper').scroll();