<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
        主站蜘蛛池模板: 亚洲国产精品免费视频| 中文字幕在亚洲第一在线| 无码区日韩特区永久免费系列| 久久国产免费直播| 久久99毛片免费观看不卡| 91精品国产免费久久国语蜜臀| 久久经典免费视频| 亚洲综合在线成人一区| 亚洲精品天堂无码中文字幕| 久久av免费天堂小草播放| 国产婷婷高清在线观看免费| 久久久亚洲欧洲日产国码农村| 亚洲香蕉久久一区二区三区四区| 午夜肉伦伦影院久久精品免费看国产一区二区三区 | 好男人视频在线观看免费看片| 亚洲精品无码专区久久同性男| 无码乱人伦一区二区亚洲一| 成全在线观看免费观看大全| 麻豆国产人免费人成免费视频| 亚洲卡一卡2卡三卡4卡无卡三| 亚洲hairy多毛pics大全| 好先生在线观看免费播放| 亚洲成亚洲乱码一二三四区软件| 亚洲欧美成人综合久久久| 久草福利资源网站免费| 波多野结衣一区二区免费视频| 亚洲精品福利网泷泽萝拉| 免费人妻无码不卡中文字幕系| 中文字幕无码精品亚洲资源网| 亚欧国产一级在线免费| 国产成人无码免费视频97| 香港特级三A毛片免费观看| 青娱乐免费视频在线观看| 亚洲AV无码专区在线亚| 久久ww精品w免费人成| 亚洲a级在线观看| 国产一区二区三区无码免费| 久久精品国产99国产精品亚洲| 成人免费无码大片a毛片软件| 91嫩草亚洲精品| 99久久久国产精品免费蜜臀|