<!-- 主页面标题 -->
<nav class="mui-bar mui-bar-tab">
<a id="home" class="mui-tab-item" href="home.html">
<span class="mui-icon mui-icon-home"></span>
<span class="mui-tab-label">首页</span>
</a>
<a id="course" class="mui-tab-item mui-active" href="course.html">
<span class="mui-icon mui-icon-extra mui-icon-extra-xiaoshuo"></span>
<span class="mui-tab-label">课程中心</span>
</a>
<a id="shoppingcart" class="mui-tab-item" href="shoppingcart.html">
<span class="mui-icon mui-icon-extra mui-icon-extra-cart"></span>
<span class="mui-tab-label">购物车</span>
</a>
<a id="my" class="mui-tab-item" href="my.html">
<span class="mui-icon mui-icon-contact"></span>
<span class="mui-tab-label">我的</span>
</a>
</nav>
document.getElementById('home').addEventListener('tap', function() {
//打开首页页面
mui.openWindow({
url:'home.html',
id: 'home'
})
});
document.getElementById('course').addEventListener('tap', function() {
//打开课程页面
mui.openWindow({
url:'course.html',
id: 'course'
})
});
document.getElementById('shoppingcart').addEventListener('tap', function() {
//打开购物车页面
mui.openWindow({
url:'shoppingcart',
id: 'shoppingcart'
})
});
以上代码 怎么合并一个 把值传进去
2 个回复
最佳回复
赵梦欢 - 专注前端,乐于分享!
建议使用on批量处理,文档在这里:事件绑定
非5+环境,可以使用iframe做兼容处理。
mui初级入门教程(二)— html5+ webview 底部栏用法详解
1***@qq.com (作者)
照着你提供的文档说明做了一遍不管用打不开子页面 不知道为什么。。。
赵梦欢
不多说,这种东西没啥好说的,思路都已经写得清清楚楚,直接上演示demo:https://rawgit.com/zhaomenghuan/mui-demo/master/example/tabbar-with-iframe/tab-webview-main.html
2016-08-22 13:48
1***@qq.com (作者)
解决了 谢谢 是我自己马虎了 路径错了
2016-08-22 13:51
1***@qq.com (作者)
回复 赵梦欢: 非常到位 万分感谢
2016-08-22 13:56