mui的header调整位置

mui.plusReady(function() {
var topoffset = '45px';
var header = document.getElementById('heardermylab'); //在head处加上id='heardermylab'
console.log(plus.navigator.isImmersedStatusbar())
if(plus.navigator.isImmersedStatusbar()) { // 兼容immersed状态栏模式
// 获取状态栏高度并根据业务需求处理,这里重新计算了子窗口的偏移位置
topoffset = (Math.round(plus.navigator.getStatusbarHeight()) + 45);
header.style.height = topoffset + 'px';
header.style.paddingTop = (topoffset - 45) + 'px';
}
});

posted @ 2019-12-09 15:58  绯颜旧雨  阅读(773)  评论(0编辑  收藏  举报