代码如下,我是想通过触发 来显示当前页面,隐藏其他页面
<nav class="mui-bar mui-bar-tab nav-bgcolor">
<a class="mui-tab-item mui-active" id="square.html">
<span class="mui-icon mui-icon-navigate"></span>
<span class="mui-tab-label">广场</span>
</a>
<a class="mui-tab-item" id="message.html">
<span class="mui-icon mui-icon-chatboxes"></span>
<span class="mui-tab-label">信息</span>
</a>
<a class="mui-tab-item" id="mine.html">
<span class="mui-icon mui-icon-contact"></span>
<span class="mui-tab-label">我的</span>
</a>
</nav>
<script type="text/javascript">
var main = null, webView = null;
var square_index = null, message_index = null, mine_html = null;
var navList = document.getElementsByClassName('mui-tab-item');
var navJson = {};
var mainStyle = {top:'45px', bottom:'45px'};
if(window.plus){
plusReady();
}else{
document.addEventListener("plusready",plusReady,false);
} // if finish;
function plusReady(){
main = plus.webview.currentWebview();
for(var i=0,n=navList.length;i<n;i++){
var id_ = navList[i].getAttribute('id');
console.log(id_)
navJson[id_] = plus.webview.create(id_, id_, mainStyle);
};
navJson['square.html'].show();
}; // function finish;
for(var i=0,n=navList.length;i<n;i++){
navList[i].onclick = function(){
alert(this.getAttribute('id'))
};
};
dewei (作者)
我用了 没用,相同的方法写一个 button 上 就 ok
2015-11-24 15:56
DCloud_UNI_FXY
回复 dewei:你怎么写的
2015-11-24 16:02