mui.init();
var index = 0;
var subviews = ["adviserHtml/index.html","interactiveHtml/index.html","interactiveHtml/chat.html","NewsHtml/index.html","MyCenterHtml/index.html"];
mui.plusReady(function () {
var self = plus.webview.currentWebview();
for(var i = 0; i<4; i++){
var subwebview = plus.webview.create(subviews[i],subviews[i],{
"top":0,
"bottom":"57px"
});
if(i!==0){
subwebview.hide();
}
self.append(subwebview);
}
var activeTab = subviews[index];
mui("#bar").on("tap","a.mui-tab-item",function(e){
var currentLink = this.getAttribute("href");
if(currentLink == activeTab){
return;
}
plus.webview.show(currentLink);
plus.webview.hide(activeTab);
activeTab = currentLink;
});
});
按照教程,做的底部切换效果。
在第一次切换的时候,页面会发生闪烁。
后面再点击则不会, 求解。
0 个回复