1. <small id='JQ9t1'></small><noframes id='JQ9t1'>

        <bdo id='JQ9t1'></bdo><ul id='JQ9t1'></ul>
    1. <legend id='JQ9t1'><style id='JQ9t1'><dir id='JQ9t1'><q id='JQ9t1'></q></dir></style></legend>

    2. <tfoot id='JQ9t1'></tfoot>
      <i id='JQ9t1'><tr id='JQ9t1'><dt id='JQ9t1'><q id='JQ9t1'><span id='JQ9t1'><b id='JQ9t1'><form id='JQ9t1'><ins id='JQ9t1'></ins><ul id='JQ9t1'></ul><sub id='JQ9t1'></sub></form><legend id='JQ9t1'></legend><bdo id='JQ9t1'><pre id='JQ9t1'><center id='JQ9t1'></center></pre></bdo></b><th id='JQ9t1'></th></span></q></dt></tr></i><div id='JQ9t1'><tfoot id='JQ9t1'></tfoot><dl id='JQ9t1'><fieldset id='JQ9t1'></fieldset></dl></div>

      mui 实现底部tab切换

      1.图标为icon字体,html代码如下: nav class="mui-bar mui-bar-tab"a id="defaultTab" class="mui-tab-item mui-active" href="suoYouWenTi.html"span class="mui-icon mui-icon-help"span class="mui-badge"9/span/spanspan class="mui-tab-label"所有提问
    3. <small id='BNmaG'></small><noframes id='BNmaG'>

          <tbody id='BNmaG'></tbody>
          <bdo id='BNmaG'></bdo><ul id='BNmaG'></ul>
          <tfoot id='BNmaG'></tfoot>
            <legend id='BNmaG'><style id='BNmaG'><dir id='BNmaG'><q id='BNmaG'></q></dir></style></legend>
            1. <i id='BNmaG'><tr id='BNmaG'><dt id='BNmaG'><q id='BNmaG'><span id='BNmaG'><b id='BNmaG'><form id='BNmaG'><ins id='BNmaG'></ins><ul id='BNmaG'></ul><sub id='BNmaG'></sub></form><legend id='BNmaG'></legend><bdo id='BNmaG'><pre id='BNmaG'><center id='BNmaG'></center></pre></bdo></b><th id='BNmaG'></th></span></q></dt></tr></i><div id='BNmaG'><tfoot id='BNmaG'></tfoot><dl id='BNmaG'><fieldset id='BNmaG'></fieldset></dl></div>

                1.图标为icon字体,html代码如下:
                <nav class="mui-bar mui-bar-tab">
                <a id="defaultTab" class="mui-tab-item mui-active" href="suoYouWenTi.html">
                <span class="mui-icon mui-icon-help"><span class="mui-badge">9</span></span>
                <span class="mui-tab-label">所有提问</span>
                </a>
                <a class="mui-tab-item " href="woDeWenTi.html">
                <span class="mui-icon mui-icon-contact"></span>
                <span class="mui-tab-label">我的提问</span>
                </a>
                <a class="mui-tab-item" href="tiWen.html">
                <span class="mui-icon mui-icon-compose"></span>
                <span class="mui-tab-label">提问</span>
                </a>
                </nav>
                js代码如下:
                <script type="text/javascript" charset="utf-8">
                //mui初始化
                mui.init();
                var subpages = ['suoYouWenTi.html', 'woDeWenTi.html', 'tiWen.html'];
                var subpage_style = {
                top: '0',
                bottom: '50px'
                };
                var aniShow = {};
                //创建子页面,首个选项卡页面显示,其它均隐藏;
                mui.plusReady(function() {
                var self = plus.webview.currentWebview();
                for (var i = 0; i < 4; i++) {
                var temp = {};
                var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);
                if (i > 0) {
                sub.hide();
                } else {
                temp[subpages[i]] = "true";
                mui.extend(aniShow, temp);
                }
                self.append(sub);
                }
                });
                
                //当前激活选项
                var activeTab = subpages[0];
                var title = document.getElementById("title");
                
                //选项卡点击事件
                mui('.mui-bar-tab').on('tap', 'a', function(e) {
                var targetTab = this.getAttribute('href');
                if (targetTab == activeTab) {
                return;
                }
                //显示目标选项卡
                if (mui.os.ios || aniShow[targetTab]) {
                plus.webview.show(targetTab);
                } else {
                var temp = {};
                temp[targetTab] = "true";
                mui.extend(aniShow, temp);
                plus.webview.show(targetTab, "fade-in", 300);
                }
                //隐藏当前;
                plus.webview.hide(activeTab);
                //更改当前活跃的选项卡
                activeTab = targetTab;
                });
                </script>
                注释:底部添加红色角标:<span class="mui-badge">9</span>,若不想要图片只需要将图片删除即可

                2.图标为图片格式
                <nav class="mui-bar mui-bar-tab">
                <a id="axx" class="mui-tab-item mui-show mui-active" href="html/yunYingGuanLi/yunYingGuanLi.html">
                <div class="box">
                <img id="img_axx" src="img/icon/index1.png"><br />
                <span class="mui-tab-label">运营状况</span>
                </div>
                </a>
                <a id="defaultTab" class="mui-tab-item mui-show" href="html/caiWuGuanLi/caiWuGuanLi.html">
                <div class="box">
                <img id="img_defaultTab" src="img/icon/cw_guanli.png">
                <br />
                <span class="mui-tab-label">经营状况</span>
                </div>
                </a>
                <a id="abm" class="mui-tab-item" href="html/tongXunLu/tongXunLu.html">
                <div class="box">
                <img id="img_abm" src="img/icon/tongXunLu.png">
                <br />
                <span class="mui-tab-label txl">通讯录</span>
                </div>
                </a>
                <a id="atxl" class="mui-tab-item mui-show" href="html/woDe/woDe.html">
                <div class="box">
                <img id="img_atxl" src="img/icon/woDe.png">
                <br />
                <span class="mui-tab-label">我的</span>
                </div>
                </a>
                </nav>
                CSS代码:
                .mui-tab-item img{
                width: 22px;
                height: 22px;
                margin-top: 3px;
                }
                #img_abm{
                width: 23px;
                height: 20px;
                margin-top: 5px;
                }
                .mui-bar .box{
                height: 50px;
                background: #fff;
                border-top: 1px solid #eee;
                font-size: 12px;
                }
                .mui-tab-label{
                display: block;
                height: 20px;
                line-height: 1;
                }
                .mui-bar-tab .mui-tab-item.mui-active {
                color: #64a6fb;
                }
                JS代码:
                //mui初始化
                mui.init();
                var showPage = 0; //底部页面切换
                var subpages = ['html/yunYingGuanLi/yunYingGuanLi.html', 'html/tongXunLu/tongXunLu.html', 'html/woDe/woDe.html'];
                if (localStorage["isRight"] == 'true') {
                showPage = 4;
                subpages = ['html/yunYingGuanLi/yunYingGuanLi.html', 'html/caiWuGuanLi/caiWuGuanLi.html',
                'html/tongXunLu/tongXunLu.html', 'html/woDe/woDe.html'
                ];
                Zepto("#defaultTab").show();
                }
                var subpage_style = {
                top: '0',
                bottom: '50px'
                };
                var aniShow = {};
                //创建子页面,首个选项卡页面显示,其它均隐藏;
                mui.plusReady(function() {
                getProInfo();
                document.addEventListener("resume", function() {
                if (mui.os.android) {
                getProInfo();
                }
                }, false);
                
                var self = plus.webview.currentWebview();
                showPage = 3;
                for (var i = 0; i < showPage; i++) {
                var temp = {};
                var sub = plus.webview.create(subpages[i], subpages[i], subpage_style);
                if (i > 0) {
                sub.hide();
                } else {
                temp[subpages[i]] = "true";
                mui.extend(aniShow, temp);
                }
                self.append(sub);
                }
                //当前激活选项
                var activeTab = subpages[0];
                //选项卡点击事件
                var enable = true;
                mui('.mui-bar-tab').on('tap', 'a', function(e) {
                var targetTab = this.getAttribute('href'); //返回指定属性名的属性值
                var id = this.getAttribute('id');
                if (targetTab == activeTab) {
                return;
                }
                
                changeImg(id);
                
                //如果不存在则创建,否则直接显示
                if (!plus.webview.getWebviewById(targetTab)) {
                plus.webview.create(targetTab, targetTab, subpage_style);
                }
                //若为iOS平台或非首次显示,则直接显示
                if (mui.os.ios || aniShow[targetTab]) {
                plus.webview.show(targetTab);
                } else {
                //否则,使用fade-in动画,且保存变量
                var temp = {};
                temp[targetTab] = "true";
                mui.extend(aniShow, temp);
                plus.webview.show(targetTab, "fade-in", 300);
                }
                //隐藏当前;
                plus.webview.hide(activeTab);
                //更改当前活跃的选项卡
                activeTab = targetTab;
                });
                
                //点击图片高亮
                function changeImg(id) {
                var idList = [
                'img_axx',
                'img_defaultTab',
                'img_abm',
                'img_atxl'
                ];
                var imgList = [
                'index',
                'cw_guanli',
                'tongXunLu',
                'woDe'
                ];
                var imgID = 'img_' + id;
                for (var i = 0; i < idList.length; i++) {
                if (idList[i] == imgID)
                document.getElementById(idList[i]).src = 'img/icon/' + imgList[i] + '1.png';
                else
                document.getElementById(idList[i]).src = 'img/icon/' + imgList[i] + '.png';
                }
                }
                
                });
                
                function getProInfo() {
                
                }
                本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!
                MUI

                相关文档推荐

                参数 说明 说明 duration 持续显示时间,默认值 short(2000ms) 支持 整数值 和 String ,String可选: long(3500ms) , short(2000ms) type 强制使用mui消息框(div模式) div mui.toast('加载中...',{ duration:'long', type:'div' }); css文件如下: .mui-toast-
                解决mui的a标签无效: mui('body').on('tap','a',function(){ window.top.location.href=this.href;}); 解决mui无法点击元素的问题:(主要是mui屏蔽了click,更换成tap即可) $('#id').on('tap','xx',function(){ //dosomething});
                我的传值 listDetail = li class=mui-table-view-cell mui-mediaa href=aJaxDetail.html?+arrayobj[i].id+div class=mui-media-body+arrayobj[i].digest+/div/a/li; 在cell 的a链接中拼接上需要传送的数据+arrayobj[i].id+ 获取数据 mui.init(); mui.plusRead
                mui prompt 弹出框设置输入框的默认值,具体代码如下: document.getElementById("promptBtn").addEventListener('tap', function(e) {e.detail.gesture.preventDefault(); //修复iOS 8.x平台存在的bug,使用plus.nativeUI.prompt会造成输入法闪一下又没了var
                layui中tab的切换,可使用element.tabChange(filter, layid);用于外部切换到指定的Tab项上,如:element.tabChange(demo, layid); //切换到 lay-id=yyy 的这一项 下例所示 element.tabChange(demo, 22); //切换到:用户管理 具体代码如下: div class="layui-
                layui使用tree组件实现树形下拉菜单,下面是具体代码: html代码: link rel="stylesheet" href="~/layui/css/layui.css" media="all" @*link rel="stylesheet" type="text/css" href="~/layui/font/"*@ style type="text/css" .treeSelect .layui-select-tit

                  <tfoot id='wqmrK'></tfoot>
                    <tbody id='wqmrK'></tbody>
                  <legend id='wqmrK'><style id='wqmrK'><dir id='wqmrK'><q id='wqmrK'></q></dir></style></legend>

                  <i id='wqmrK'><tr id='wqmrK'><dt id='wqmrK'><q id='wqmrK'><span id='wqmrK'><b id='wqmrK'><form id='wqmrK'><ins id='wqmrK'></ins><ul id='wqmrK'></ul><sub id='wqmrK'></sub></form><legend id='wqmrK'></legend><bdo id='wqmrK'><pre id='wqmrK'><center id='wqmrK'></center></pre></bdo></b><th id='wqmrK'></th></span></q></dt></tr></i><div id='wqmrK'><tfoot id='wqmrK'></tfoot><dl id='wqmrK'><fieldset id='wqmrK'></fieldset></dl></div>

                    <small id='wqmrK'></small><noframes id='wqmrK'>

                      • <bdo id='wqmrK'></bdo><ul id='wqmrK'></ul>