用这个的时候webviewGroup 出现一个页面挖法打开,只有点返回,才会出现页面,不知道是为什么?
日志是这样的,[LOG] : 请求的页面无法打开:
真机上是无法打开页面的提示页面!检查过了,一直存在,代码
<div id="slider" class="mui-slider mui-fullscreen">
<div id="sliderSegmentedControl" class="mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
<div class="mui-scroll">
<a class="mui-control-item mui-active" href="#item1mobile" data-wid="news_all.html">
综合新闻
</a>
<a class="mui-control-item" href="#item2mobile" data-wid="news_personal.html">
人事新闻
</a>
<a class="mui-control-item" href="#item3mobile" data-wid="news_market.html">
市场新闻
</a>
</div>
</div>
</div>
下面,js
<script src="../js/webviewGroup.js" type="text/javascript" charset="utf-8"></script>
<script>
mui.init();
mui.plusReady(function() {
var group = new webviewGroup("viewgroup", {
items: [{
id: "news_all.html",
url: "news_all.html",
extras: {}
}, {
id: "news_personal.html",
url: "news_personal.html",
extras: {}
}, {
id: "news_market.html",
url: "news_market.html",
extras: {}
}],
onChange: function(obj) {
var c = document.querySelector(".mui-control-item.mui-active");
if(c) {
c.classList.remove("mui-active");
}
document.querySelector(".mui-scroll .mui-control-item:nth-child(" + (parseInt(obj.index) + 1) + ")").classList.add("mui-active");
}
});
mui(".mui-scroll").on("tap", ".mui-control-item", function(e) {
var wid = this.getAttribute("data-wid");
group.switchTab(wid);
});
});
mui.back = function() {
var _self = plus.webview.currentWebview();
_self.close("auto");
}
</script>
铧铧
太感谢了。解决了。
2017-08-08 20:41
Lspring
谢谢
2017-09-05 09:25
大冯
但是按手机退回键的时候,退回不到上一个页面,这样该如何解决,请问?
2018-01-23 18:33
兮颜A
用了还是报错啊
2018-06-06 10:57
在职憨生
感谢感谢
2018-06-08 17:20
8***@qq.com
感谢大佬
2019-03-05 15:03