如题。nav和aside在同一界面时,nav不会居底
lobtao
- 发布:2014-10-22 20:50
- 更新:2014-10-28 12:21
- 阅读:1869
4 个回复
DCloud_UNI_CHB
aside上加了哪些class?有完整代码吗?
lobtao (作者)
{{{
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>MUI测试</title>
<meta content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">
<meta content="yes" name="apple-mobile-web-app-capable">
<meta content="black" name="apple-mobile-web-app-status-bar-style">
</head>
<body>
<style>
.mui-control-content-my {
display: none;
}
</style>
<div class="mui-off-canvas-wrap" >
<div class="mui-inner-wrap">
<aside class="mui-off-canvas-left" id="offCanvas">
<button class="mui-btn mui-btn-primary mui-btn-block" id="offCanvasHide">
关闭侧滑菜单(js call)
</button>
<ul class="mui-table-view mui-table-view-chevron mui-table-view-inverted">
<li class="mui-table-view-cell">
<a class="mui-navigate-right">
Item 1
</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">
Item 2
</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right">
Item 3
</a>
</li>
</ul>
</aside>
<header class="mui-bar mui-bar-nav">
<!--<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>-->
<a class="mui-icon mui-icon-bars mui-pull-left" href="#offCanvas"></a>
</header>
<!--<header class="mui-bar mui-bar-nav">-->
<!--<a class="mui-icon mui-icon-bars mui-pull-left" href="#offCanvas"></a>-->
<!--<a class="mui-action-back mui-btn mui-btn-link mui-pull-right">关闭</a>-->
<!--<h1 class="mui-title">右滑导航</h1>-->
<!--</header>-->
<nav class="mui-bar mui-bar-tab ">
<a href="#tabbar" class="mui-tab-item mui-active">
<span class="mui-icon mui-icon-phone"></span>
<span class="mui-tab-label">电话咨询</span>
</a>
<a href="#tabbar-with-chat" class="mui-tab-item">
<span class="mui-icon mui-icon-email"></span>
<span class="mui-tab-label">短信咨询</span>
</a>
<a href="#tabbar-with-contact" class="mui-tab-item">
<span class="mui-icon mui-icon-contact"></span>
<span class="mui-tab-label">通讯录</span>
</a>
<a href="#tabbar-with-map" class="mui-tab-item">
<span class="mui-icon mui-icon-map"></span>
<span class="mui-tab-label">查看地图</span>
</a>
</nav>
<div class="mui-content mui-off-canvas-height-fixed">
<div class="mui-control-content-my mui-active" id="tabbar">
<ul class="mui-table-view mui-grid-view mui-grid-9">
<li class="mui-table-view-cell mui-media mui-col-xs-4">
<span class="mui-icon mui-icon-home"></span>
</ul>
<div class="mui-slider">
<div class="mui-slider-group">
<div class="mui-slider-item">
<ul class="mui-table-view mui-grid-view mui-grid-9">
<li class="mui-table-view-cell mui-media mui-col-xs-4">
<a>
</div>
</div>
<div class="mui-control-content-my" id="tabbar-with-chat">
<div class="mui-content-padded">
<h5>登录框</h5>
</div>
<div class="mui-control-content-my" id="tabbar-with-contact">
<ul class="mui-table-view mui-grid-view mui-grid-9">
<li class="mui-table-view-cell mui-media mui-col-xs-4">
<span class="mui-icon mui-icon-home"></span>
</div>
<div class="mui-control-content-my" id="tabbar-with-map">
</div>
</div>
</div>
<!--<div class="mui-off-canvas-backdrop"></div>-->
</div>
<script type="text/javascript">
$(function () {
// var offCanvasContainer = document.querySelector('.mui-off-canvas-wrap');
// var offCanvasInnerContainer = offCanvasContainer.querySelector('.mui-inner-wrap');
var offCanvas = mui('#offCanvas');
// document.getElementById('switch').addEventListener('toggle', function(event) {
// if (event.detail.isActive) { //整体滑动时,侧滑菜单在inner-wrap内
// offCanvasInnerContainer.insertBefore(offCanvas[0], offCanvasInnerContainer.firstElementChild);
// } else { //仅主内容滑动时,侧滑菜单在off-canvas-wrap内
// offCanvasContainer.insertBefore(offCanvas[0], offCanvasContainer.firstElementChild)
// }
// });
document.getElementById('offCanvasShow').addEventListener('tap', function () {
//offCanvas.offCanvas('toggle')//toggle or show;
offCanvas.offCanvas('show');
console.log('show');
});
document.getElementById('offCanvasHide').addEventListener('tap', function () {
//offCanvas.offCanvas('toggle')//toggle or hide;
offCanvas.offCanvas('hide');
console.log('hide');
});
});
</script>
<script>
</script>
</body>
</html>
}}}
DCloud_UNI_FXY
参考hello-mui里边的offcanvas-with-left.html代码。
DCloud_UNI_CHB
你这个页面是要使用可拖拽式侧滑导航是吗?
简单解决方案,自定义css:
{{{
.mui-off-canvas-wrap .mui-inner-wrap .mui-bar {
position: fixed;
}
}}}