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,11 +60,21 @@ ...@@ -60,11 +60,21 @@
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() {
var id = this.getAttribute("href");
var type = this.getAttribute("open-type");
if(type=="common"){
mui.openWindow({
id: id,
url: this.href,
waiting:{
autoShow:false
}
});
}else{
if(subWebview==null){ if(subWebview==null){
subWebview = plus.webview.getWebviewById("template_sub"); subWebview = plus.webview.getWebviewById("template_sub");
template = plus.webview.getWebviewById("demoTemplate"); template = plus.webview.getWebviewById("demoTemplate");
} }
var title = this.innerText; var title = this.innerText;
template.evalJS("with(document.getElementById('title')){innerHTML='" + title + "';className='mui-title mui-fadein';};"); template.evalJS("with(document.getElementById('title')){innerHTML='" + title + "';className='mui-title mui-fadein';};");
if(subWebview.getURL()==this.href){ if(subWebview.getURL()==this.href){
...@@ -74,8 +84,11 @@ ...@@ -74,8 +84,11 @@
} }
template.show('slide-in-right', 150); 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