mui的底部导航栏(引用外部图片)
<!-- 底部导航 --> <nav class="mui-bar mui-bar-tab"> <a class="mui-tab-item mui-active" href="index" id="index"> <div><img src="../img/sy1-2.png" width="22px" style="margin-top: 4px;" /></div> <span class="mui-tab-label">首页</span> </a> <a class="mui-tab-item " id="MyCourse"> <div><img src="../img/sy2-1.png" width="21px" style="margin-top: 4px;" /></div> <span class="mui-tab-label">学习</span> </a> <a class="mui-tab-item" id="MyTest"> <div><img src="../img/sy3-1.png" width="24px" style="margin-top: 4px;" /></div> <span class="mui-tab-label">考试</span> </a> <a class="mui-tab-item" id="Myhome"> <div><img src="../img/sy4-1.png" width="20px" style="margin-top: 4px;" /></div> <span class="mui-tab-label">我的</span> </a> </nav>
底部导航的跳转:
window.onload = function() {
//tap为mui封装的单击事件,可参考手势事件章节
document.getElementById('index').addEventListener('tap', function() {
//打开关于页面
mui.openWindow({
url: '../index.html',
id: 'index'
});
});
//tap为mui封装的单击事件,可参考手势事件章节
document.getElementById('MyCourse').addEventListener('tap', function() {
//打开关于页面
mui.openWindow({
url: './MyCourse.html',
id: 'MyCourse'
});
});
//tap为mui封装的单击事件,可参考手势事件章节
document.getElementById('MyTest').addEventListener('tap', function() {
//打开关于页面
mui.openWindow({
url: './MyTest.html',
id: 'MyTest'
});
});
//tap为mui封装的单击事件,可参考手势事件章节
document.getElementById('Myhome').addEventListener('tap', function() {
//打开关于页面
mui.openWindow({
url: './Myhome.html',
id: 'Myhome'
});
});
}