Commit bf7e9622 authored by hbcui1984's avatar hbcui1984

解决hello mui首页侧滑导航链接错误的问题

parent 8a121cd5
...@@ -31,12 +31,12 @@ ...@@ -31,12 +31,12 @@
</a> </a>
</li> </li>
<li class="mui-table-view-cell"> <li class="mui-table-view-cell">
<a class="mui-navigate-right" href="switches.html"> <a class="mui-navigate-right" open-type="common" href="inputs.html">
input(输入框) input(输入框)
</a> </a>
</li> </li>
<li class="mui-table-view-cell"> <li class="mui-table-view-cell">
<a class="mui-navigate-right" href="switches.html"> <a class="mui-navigate-right" href="tableview-image-left.html">
media list(图文列表) media list(图文列表)
</a> </a>
</li> </li>
...@@ -60,22 +60,35 @@ ...@@ -60,22 +60,35 @@
index = plus.webview.currentWebview().opener(); index = plus.webview.currentWebview().opener();
}) })
mui('.mui-table-view').on('tap', 'a', function() { mui('.mui-table-view').on('tap', 'a', function() {
if(subWebview==null){ var id = this.getAttribute("href");
subWebview = plus.webview.getWebviewById("template_sub"); var type = this.getAttribute("open-type");
template = plus.webview.getWebviewById("demoTemplate"); if(type=="common"){
} mui.openWindow({
id: id,
var title = this.innerText; url: this.href,
template.evalJS("with(document.getElementById('title')){innerHTML='" + title + "';className='mui-title mui-fadein';};"); waiting:{
if(subWebview.getURL()==this.href){ autoShow:false
subWebview.show(); }
});
}else{ }else{
subWebview.loadURL(this.href); if(subWebview==null){
} subWebview = plus.webview.getWebviewById("template_sub");
template.show('slide-in-right', 150); template = plus.webview.getWebviewById("demoTemplate");
}
var title = this.innerText;
template.evalJS("with(document.getElementById('title')){innerHTML='" + title + "';className='mui-title mui-fadein';};");
if(subWebview.getURL()==this.href){
subWebview.show();
}else{
subWebview.loadURL(this.href);
}
template.show('slide-in-right', 150);
}
//然后要关闭侧滑菜单; //然后要关闭侧滑菜单;
index.evalJS("toggleMenu()"); index.evalJS("toggleMenu()");
}); });
</script> </script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment