<span id="mktg5"></span>

<i id="mktg5"><meter id="mktg5"></meter></i>

        <label id="mktg5"><meter id="mktg5"></meter></label>
        最新文章專題視頻專題問答1問答10問答100問答1000問答2000關(guān)鍵字專題1關(guān)鍵字專題50關(guān)鍵字專題500關(guān)鍵字專題1500TAG最新視頻文章推薦1 推薦3 推薦5 推薦7 推薦9 推薦11 推薦13 推薦15 推薦17 推薦19 推薦21 推薦23 推薦25 推薦27 推薦29 推薦31 推薦33 推薦35 推薦37視頻文章20視頻文章30視頻文章40視頻文章50視頻文章60 視頻文章70視頻文章80視頻文章90視頻文章100視頻文章120視頻文章140 視頻2關(guān)鍵字專題關(guān)鍵字專題tag2tag3文章專題文章專題2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章專題3
        問答文章1 問答文章501 問答文章1001 問答文章1501 問答文章2001 問答文章2501 問答文章3001 問答文章3501 問答文章4001 問答文章4501 問答文章5001 問答文章5501 問答文章6001 問答文章6501 問答文章7001 問答文章7501 問答文章8001 問答文章8501 問答文章9001 問答文章9501
        當(dāng)前位置: 首頁 - 科技 - 知識百科 - 正文

        基于jquery的時間段實(shí)現(xiàn)代碼_jquery

        來源:懂視網(wǎng) 責(zé)編:小采 時間:2020-11-27 21:04:44
        文檔

        基于jquery的時間段實(shí)現(xiàn)代碼_jquery

        基于jquery的時間段實(shí)現(xiàn)代碼_jquery:json字符串: 代碼如下:var mcode={minfo:[{time:9:00-10:00,status:2},{time:10:00-11:00,status:1},{time:11:00-12:00,status:3},{time:13:00-14:00,status:1},{time
        推薦度:
        導(dǎo)讀基于jquery的時間段實(shí)現(xiàn)代碼_jquery:json字符串: 代碼如下:var mcode={minfo:[{time:9:00-10:00,status:2},{time:10:00-11:00,status:1},{time:11:00-12:00,status:3},{time:13:00-14:00,status:1},{time

        json字符串:
        代碼如下:var mcode={"minfo":[{"time":"9:00-10:00","status":2},{"time":"10:00-11:00","status":1},{"time":"11:00-12:00","status":3},{"time":"13:00-14:00","status":1},{"time":"14:00-15:00","status":1},{"time":"15:00-16:00","status":1},{"time":"16:00-17:00","status":1},{"time":"17:00-18:00","status":1}]};
        其中time代表時間段,status當(dāng)職位1時代表可以使用,2時代表已過期,3時代表已選滿。
        通過循環(huán)遍歷json字符串中的數(shù)據(jù)值。
        代碼如下:
        for(var i in mcode.minfo){
        mcode.minfo[i].time + mcode.minfo[i].status;
        }

        當(dāng)前時間段為已過期或以選滿時,鼠標(biāo)移動到其當(dāng)前時間段上時提示相應(yīng)信息,鼠標(biāo)移開取消提示。
        當(dāng)前時間段為橘黃色代表可以選擇。
        代碼如下:
        $.each($("#test span"),function(k,v){
        if($(this).hasClass("unspan1")||$(this).hasClass("unspan2")){
        $(this).hover(function(){
        $(this).find("label").css({"display":"block"});
        $(this).find("em").css({"display":"block"});
        }, function(){
        $(this).find("label").css({"display":"none"});
        $(this).find("em").css({"display":"none"});
        });
        }
        else{
        $(this).click(function(){
          $("#result").empty().html("您選擇了:"+$(this).text());
        });
        }
        });

        拼接字符串,構(gòu)建html結(jié)構(gòu)。
        代碼如下:
        for(var i in mcode.minfo){
        if(mcode.minfo[i].status===2){
        html+='}
        else if(mcode.minfo[i].status===3){
        html+='}
        else{
        html+='}
        if((i+1)%3===0){
        html+='" >';
        }
        else{
        html+='mspan" >';
        }
        html+=mcode.minfo[i].time;
        if(mcode.minfo[i].status===2){
        html+='';
        }
        else if(mcode.minfo[i].status===3){
        html+='';
        }
        if(mcode.minfo[i].status!==1){
        html+='';
        }
        html+="";
        }

        css樣式:
        代碼如下:
        #test{ width: 430px; padding: 35px; border: 1px solid #666666;overflow: hidden; margin: 100px auto 0px;}
        #test span{display:block; background: #FF6600; width:130px; height: 30px; line-height: 30px; text-align: center; float:left;
        _display:inline; position:relative; margin-bottom: 15px; cursor: pointer;}
        #test .mspan{margin-right: 20px;}
        #test .unspan1{background: #D2E0E6; cursor:default}
        #test .unspan2{background: #ffcaca; cursor: default;}
        #test label{position: absolute; left:25px; top:-18px; width: 60px; line-height: 20px; background: #F3F3F3;
        padding:1px 10px; border:1px solid #CCCCCC;display: none;}
        #test em{display: block;border-color: #F3F3F3 transparent transparent transparent;border-style: solid;border-width: 6px 6px 6px 6px;
        padding: 0;width: 0;height: 0;
        font-size: 0;line-height: 0;
        position: absolute;left:58px; top:5px;display:none;
        _border-top-color: #F3F3F3;_border-bottom-color: #F3F3F3;
        _filter: chroma( color = #F3F3F3);
        }
        #result{ margin: 10px auto 0px; text-align: center}

        實(shí)例:
        代碼如下:





        聲明:本網(wǎng)頁內(nèi)容旨在傳播知識,若有侵權(quán)等問題請及時與本網(wǎng)聯(lián)系,我們將在第一時間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com

        文檔

        基于jquery的時間段實(shí)現(xiàn)代碼_jquery

        基于jquery的時間段實(shí)現(xiàn)代碼_jquery:json字符串: 代碼如下:var mcode={minfo:[{time:9:00-10:00,status:2},{time:10:00-11:00,status:1},{time:11:00-12:00,status:3},{time:13:00-14:00,status:1},{time
        推薦度:
        標(biāo)簽: 時間 的時間 代碼
        • 熱門焦點(diǎn)

        最新推薦

        猜你喜歡

        熱門推薦

        專題
        Top
        主站蜘蛛池模板: 精品免费国产一区二区三区| 国产成人精品免费久久久久| 成人免费无码大片a毛片| 亚洲精品免费在线| 国产高清免费视频| 亚洲一区二区免费视频| 欧洲精品成人免费视频在线观看| 亚洲免费视频网址| 毛片大全免费观看| 亚洲av色香蕉一区二区三区| 免费v片在线观看品善网| 人成电影网在线观看免费| 亚洲一级片免费看| 久章草在线精品视频免费观看| 亚洲男人都懂得羞羞网站| 最近中文字幕电影大全免费版| 亚洲国语在线视频手机在线| 国产成人A在线观看视频免费 | 久久黄色免费网站| 亚洲女人18毛片水真多| 国产美女被遭强高潮免费网站| 免费国产a理论片| 久久被窝电影亚洲爽爽爽| 99免费在线观看视频| 亚洲www在线观看| 亚洲免费日韩无码系列| 一级毛片免费不卡在线| 亚洲欧美日本韩国| 国产亚洲一区二区三区在线不卡| 鲁大师在线影院免费观看| 最新亚洲卡一卡二卡三新区| 亚洲精品麻豆av| 最近2018中文字幕免费视频| 亚洲国产欧美国产综合一区 | 亚洲精品美女在线观看| 麻豆国产人免费人成免费视频| 中文字幕免费视频精品一| 欧洲人成在线免费| 亚洲精品国产精品| 情人伊人久久综合亚洲| 全免费一级午夜毛片|