7***@qq.com
7***@qq.com
  • 发布:2017-03-27 16:52
  • 更新:2017-03-28 09:13
  • 阅读:1465

侧滑后 a 标签无法进行页面跳转

分类:MUI

在页面侧滑后 的item中进行a标签的页面跳转无法跳转,下面是页面和js代码

js

define(function(require, exports, module) {
"require:nomunge,exports:nomunge,module:nomunge";
var mui = require('/assets/js/mui.min.js');
require('/assets/js/jquery.js');
require('/assets/js/jquery.md5.js');

mui.init();  
//侧滑容器父节点  
var offCanvasWrapper = mui('#offCanvasWrapper');  
//主界面容器  
var offCanvasInner = offCanvasWrapper[0].querySelector('.mui-inner-wrap');  
//菜单容器  
var offCanvasSide = document.getElementById("offCanvasSide");  
if (!mui.os.android) {  
    //document.getElementById("move-togger").classList.remove('mui-hidden');  
    var spans = document.querySelectorAll('.android-only');  
    for (var i = 0, len = spans.length; i < len; i++) {  
        spans[i].style.display = "none";  
    }  
}  
//移动效果是否为整体移动  
var moveTogether = false;  
//侧滑容器的class列表,增加.mui-slide-in即可实现菜单移动、主界面不动的效果;  
var classList = offCanvasWrapper[0].classList;  
//仅主内容滑动时,侧滑菜单在off-canvas-wrap内,和主界面并列  
offCanvasWrapper[0].insertBefore(offCanvasSide, offCanvasWrapper[0].firstElementChild);  
//主界面和侧滑菜单界面均支持区域滚动;  
mui('#offCanvasSideScroll').scroll();  
mui('#offCanvasContentScroll').scroll();  
//实现ios平台原生侧滑关闭页面;  
if (mui.os.plus && mui.os.ios) {  
    mui.plusReady(function() { //5+ iOS暂时无法屏蔽popGesture时传递touch事件,故该demo直接屏蔽popGesture功能  
        plus.webview.currentWebview().setStyle({  
            'popGesture': 'none'  
        });  
    });  
}  
if (window.plus) {  
    plusReady();  
} else {  
    document.addEventListener('plusready', plusReady, false);  
}  

function plusReady() {  
    mui.back = function() {  
        mui.confirm('确认退出?', '', ["确定", "取消"], function(e) {  
            if (e.index == 0) {  
                plus.runtime.quit();  
            }  
        });  
    }  
}  

});

页面
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
<meta charset="UTF-8">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<title></title>
<link rel="stylesheet" href="/assets/css/mui.min.css" />
<link rel="stylesheet" href="/assets/css/pages_mobile/index.css"/>
<style>
html,
body {
background-color: #efeff4;
}
p {
text-indent: 22px;
}
span.mui-icon {
font-size: 14px;
color: #007aff;
margin-left: -15px;
padding-right: 10px;
}
.mui-off-canvas-left {
color: #fff;
}
.title {
margin: 35px 15px 10px;
}
.title+.content {
margin: 10px 15px 35px;
color: #bbb;
text-indent: 1em;
font-size: 14px;
line-height: 24px;
}
input {
color: #000;
}
</style>
</head>
<body>

<div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-draggable">
<!--侧滑菜单部分-->
<aside id="offCanvasSide" class="mui-off-canvas-left">
<div id="offCanvasSideScroll" class="mui-scroll-wrapper">
<div class="mui-scroll">
<div style="padding-top: 45px">

            </div>  
            <ul class="mui-table-view mui-table-view-chevron mui-table-view-inverted">  
                <li class="mui-table-view-cell">  
                    <a class="mui-navigate-right">  
                        售卖机  
                    </a>  
                </li>  
                <li class="mui-table-view-cell">  
                    <a class="mui-navigate-right">  
                        报表  
                    </a>  
                </li>  
                <li class="mui-table-view-cell">  
                    <a class="mui-navigate-right" href="/views/mobile/manage/setting/setting.html">  
                        设置  
                    </a>  
                </li>  
            </ul>  
        </div>  
    </div>  
</aside>  
<!--主界面部分-->  
<div class="mui-inner-wrap">  
    <header class="mui-bar mui-bar-nav">  
        <a href="#offCanvasSide" class="mui-icon mui-action-menu mui-icon-bars mui-pull-left"></a>  
        <h1 class="mui-title">自动售卖机管理系统</h1>  
    </header>  
    <div id="offCanvasContentScroll" class="mui-content mui-scroll-wrapper">  
        <div class="mui-scroll">  
            <div id="body"></div>  
        </div>  
    </div>  
    <!-- off-canvas backdrop -->  
    <div class="mui-off-canvas-backdrop"></div>  
</div>  

</div>
<script type="application/javascript" src="/assets/js/sea.js"></script>
<script type="application/javascript">
seajs.use('/assets/js/pages_mobile/manage/index.js');
</script>
</body>
</html>

2017-03-27 16:52 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复