第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問(wèn)題,去搜搜看,總會(huì)有你想問(wèn)的

怎么可以讓每個(gè)全選選擇它對(duì)應(yīng)的內(nèi)容,讓每個(gè)全選獨(dú)立,

怎么可以讓每個(gè)全選選擇它對(duì)應(yīng)的內(nèi)容,讓每個(gè)全選獨(dú)立,

qq__8222 2017-07-02 10:12:34
<!DOCTYPE html><html><head>?? ?<meta charset="UTF-8">?? ?<title>Document</title>?? ?<script type="text/javascript" src="jquery.js"></script>?? ?<style type="text/css">?? ?/*公共*/div,p,span,a,img,ul,ol,li,body {?? ?margin:0;?? ?padding: 0;}ul li{?? ?list-style: none;}.added{?? ?position: absolute;?? ?left:16%;}.cashier{?? ?width:915px;}.cashier_ul{?? ?width:100%;}.cashier_ul li{?? ?width:135px;?? ?height:40px;?? ?float: left;}.clouds ul{?? ?display: flex;}.clouds ul li{?? ?float: left;?? ?height:40px;?? ?border:1px solid #ccc;?? ?width:10.85%;?? ?text-align: center;?? ?line-height: 40px;?? ?border-top:none;?? ?border-right:none;?? ?flex:1;}li.clo_tab{?? ?background-color: #63cfde;?? ?border:1px solid #009abd;}.clouds ul li.clo_tab a{?? ?color:#fff;?? ?}.clouds_tab{?? ?border:1px solid #ccc;?? ?border-top:none;?? ?overflow: auto;?? ?padding:5px;?? ?display: none;}.clo_tab_center{?? ?display: block;}?? ?</style></head><body>?? <div class="added cl">??????????????????? <div class="cashier">?? ??? ??? ??? ??? ??? ?<div class="clouds">??????????????????????????? <ul>??????????????????????????????? <li class="clo_tab"><a href="#">銷售</a></li>??????????????????????????????? <li><a href="#">商品</a></li>??????????????????????????????? <li><a href="#">庫(kù)存</a></li>??????????????????????????? </ul>??????????????????????? </div>??????????????????????? <div class="div_tab">??????????????????????????? <div class="clouds_tab clo_tab_center">??????????????????????????????? <div class="select_all">??????????????????????????????????? <input type="checkbox" name="" id="all" class="all">??????????????????????????????????? <label for="all" id="selectAll2">全選</label>??????????????????????????????? </div>??????????????????????????????? <ul class="cashier_ul list">??????????????????????????????????? <li><label><input type="checkbox" value=""> 營(yíng)業(yè)概況</label></li>??????????????????????????????????? <li><label><input type="checkbox" value=""> 營(yíng)業(yè)概況</label></li>??????????????????????????????????? <li><label><input type="checkbox" value=""> 營(yíng)業(yè)概況</label></li>??????????????????????????????????? <li><label><input type="checkbox" value=""> 營(yíng)業(yè)概況</label></li>??????????????????????????????? </ul>??????????????????????????? </div>??????????????????????????? <div class="clouds_tab">??????????????????????????????? <div class="select_all">??????????????????????????????????? <input type="checkbox" name="" id="all" class="all">??????????????????????????????????? <label for="all"? id="selectAll2">全選</label>??????????????????????????????? </div>??????????????????????????????? <ul? class="cashier_ul list"> ???????????????????????????????????? <li><label><input type="checkbox" value=""> 允許收銀</label></li>??????????????????????????????????? <li><label><input type="checkbox" value=""> 禁止無(wú)碼收銀</label></li>??????????????????????????????????? <li><label><input type="checkbox" value=""> 編輯商品資料</label></li>??????????????????????????????????? <li><label><input type="checkbox" value=""> 單品改價(jià)</label></li>??????????????????????????????? </ul>??????????????????????????? </div>??????????????????????????? <div class="clouds_tab">??????????????????????????????? <div class="select_all">??????????????????????????????????? <input type="checkbox" name="" id="all" class="all">??????????????????????????????????? <label for="all" id="selectAll2">全選</label>??????????????????????????????? </div>??????????????????????????????? <ul? class="cashier_ul list"> ???????????????????????????????????? <li><label><input type="checkbox" value=""> 前臺(tái)進(jìn)貨</label></li>??????????????????????????????????? <li><label><input type="checkbox" value=""> 前臺(tái)進(jìn)貨</label></li>??????????????????????????????????? <li><label><input type="checkbox" value=""> 前臺(tái)進(jìn)貨</label></li>??????????????????????????????? </ul>??????????????????????????? </div>??????????????????????? </div>??????????????????? </div>?? ???????????? </div></body><script type="text/javascript">//全選或全不選?? ??? ??? ?$(".all").click(function(){? ??? ??? ??? ???? if(this.checked){? ??? ??? ??? ???????? $(".list :checkbox").prop("checked", true); ??? ??? ??? ???? }else{? ??? ??? ??? ??? ??? ?$(".list :checkbox").prop("checked", false);?? ??? ??? ???? }? ??? ??? ??? ?});?? ??? ??? ?//設(shè)置全選復(fù)選框?? ??? ??? ?$(".list :checkbox").click(function(){?? ??? ??? ??? ?allchk();?? ??? ??? ?});?? ??? ??? ?function allchk(){?? ??? ??? ??? ?var chknum = $(".list :checkbox").size();//選項(xiàng)總個(gè)數(shù)?? ??? ??? ??? ?var chk = 0;?? ??? ??? ??? ?$(".list :checkbox").each(function () { ??? ??? ??? ???????? if($(this).prop("checked")==true){?? ??? ??? ??? ??? ??? ?chk++;?? ??? ??? ??? ??? ?}?? ??? ??? ???? });?? ??? ??? ??? ?if(chknum==chk){//全選?? ??? ??? ??? ??? ?$(".all").prop("checked",true);?? ??? ??? ??? ?}else{//不全選?? ??? ??? ??? ??? ?$(".all").prop("checked",false);?? ??? ??? ??? ?}?? ??? ??? ?}// tab切換$(".clouds ul li").click(function(){ ?? ??? ??? ??? ?$(this).addClass("clo_tab").siblings().removeClass("clo_tab"); ??? ??? ??? ??? ?var index = $(this).index();?? ??? ??? ??? ?$(".div_tab>div").eq(index).show().siblings().hide();?? ??? ??? ?})</script></html>
查看完整描述

3 回答

已采納
?
李曉健

TA貢獻(xiàn)1036條經(jīng)驗(yàn) 獲得超461個(gè)贊

//全選或全不選
$(".all").click(function(){
????//獲取當(dāng)前全選所管轄的區(qū)域
????var?box?=?this.parentElement.parentElement;
????//獲取當(dāng)前全選所管轄的所有checkbox
????var?checkboxs?=?$(".list?:checkbox",box);
????if(this.checked){
????????checkboxs.prop("checked",?true);
????}else{
????????checkboxs.prop("checked",?false);
????}
});
//設(shè)置全選復(fù)選框
$(".list?:checkbox").click(function(){
????//把當(dāng)前checkbox傳出去
????allchk(this);
});
function?allchk(checkbox){
????//獲取當(dāng)前checkbox所在的區(qū)域
????var?box?=?checkbox.parentElement.parentElement;
????//獲取和當(dāng)前checkbox?一組的其他checkbox
????var?checkboxs?=?$(".list?:checkbox",box);
????var?chknum?=?checkboxs.size();//選項(xiàng)總個(gè)數(shù)
????var?chk?=?0;
????checkboxs.each(function?()?{
????????if($(this).prop("checked")==true){
????????????chk++;
????????}
????});
????//獲取當(dāng)前checkbox所對(duì)應(yīng)的全選按鈕
????var?checkAll?=?$(".all",box);
????if(chknum==chk){//全選
????????checkAll.prop("checked",true);
????}else{//不全選
????????checkAll.prop("checked",false);
????}
}

在不改動(dòng)你的html結(jié)構(gòu)的前提下,可以像上面這樣實(shí)現(xiàn)。希望你能看懂,另外說(shuō)明一下,頁(yè)面的id應(yīng)該是唯一的,也就是說(shuō)不可以有兩個(gè)id值相同的標(biāo)簽在同一個(gè)頁(yè)面,你的頁(yè)面有好幾個(gè)重復(fù)的id。



如果你的問(wèn)題已解決,請(qǐng)記得采納答案!


查看完整回答
1 反對(duì) 回復(fù) 2017-07-03
?
李曉健

TA貢獻(xiàn)1036條經(jīng)驗(yàn) 獲得超461個(gè)贊

function?allchk(checkbox){
????//這里少寫了2層
????var?box?=?checkbox.parentElement.parentElement.parentElement.parentElement;
????var?checkboxs?=?$(".list?:checkbox",box);
????var?chknum?=?checkboxs.size();
????var?chk?=?0;
????checkboxs.each(function?()?{
????????if($(this).prop("checked")==true){
????????????chk++;
????????}
????});
????var?checkAll?=?$(".all",box);
????if(chknum==chk){
????????checkAll.prop("checked",true);
????}else{
????????checkAll.prop("checked",false);
????}
}


查看完整回答
反對(duì) 回復(fù) 2017-07-03
  • 3 回答
  • 0 關(guān)注
  • 1609 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)