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

                相关文档推荐

                layui实现图片上传成功后回显点击放大图片功能,html代码部分: !-- html代码--div class="layui-form-item" label class="layui-form-label"上传图片/label div class="layui-input-block" button type="button" class="layui-btn" id="license-auth-letter-
                Layui实现数据表格中鼠标悬停图片放大离开时恢复原图的效果,最终效果如下图所示: 实现代码如下,在done函数中调用hoverOpenImg方法 var tableIns = window.demoTable = table .render({ elem : '#idTest', id : 'idTest', url : '/postData', //width : 150
                做小程序项目的时候,客户提了一个功能需求优化,就是长按文字需要复制全部内容,因为有的手机支持全选复制,有的手机不支持全选复制。 通过设置系统剪贴板的内容和获取系统剪贴板的内容实现复制功能 html相关代码: van-field value="{{form.contactPhone}}"
                最近项目中遇到需要下拉框能实现根据首字母进行模糊搜索,下拉框使用的是xm-select,而xm-select支持中文的搜索,后端接口也仅支持中文的。因此需要借助其他插件来完成功能。最终实现的效果如下: 涉及到的基础文件:引用 pinyin.js 和 initials.js。再引用 l
                按钮代码如下: {field: 'state', title: '状态', width: 85, templet: function (data) { if (data.state == 0) { return 'div input type="checkbox" checked="" name="codeSwitch" lay-skin="switch" id="open" lay-filter="switchTest" switchId=' + data
                参数 说明 说明 duration 持续显示时间,默认值 short(2000ms) 支持 整数值 和 String ,String可选: long(3500ms) , short(2000ms) type 强制使用mui消息框(div模式) div mui.toast('加载中...',{ duration:'long', type:'div' }); css文件如下: .mui-toast-

                  <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>