我有这样的物品
- 红色(5)
- 蓝色(0)
- 黑色(4)
我只有一个依赖项,这些是第 4、14 和 23 行
<div class="oiu">
<ul class="woof_list woof_list_checkbox">
<li class="woof_term_37 ">
<div class="icheckbox_flat-blue" >
<input type="checkbox" id="woof_37_5ddabd90b31f1" class="woof_checkbox_term woof_checkbox_term_37" data-tax="pa_zvet" name="asdf" data-term-id="37" value="37" style="position: absolute; opacity: 0;">
<ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
</div>
<label class="woof_checkbox_label " for="woof_37_5ddabd90b31f1">Красный<span class="woof_checkbox_count">(5)</span>
</label>
<input type="hidden" value="Красный" data-anchor="woof_n_pa_zvet_red">
</li>
<li class="woof_term_35 " >
<div class="icheckbox_flat-blue disabled" style="position: relative;">
<input type="checkbox" disabled="" id="woof_35_5ddabd90b4de9" class="woof_checkbox_term woof_checkbox_term_35" data-tax="pa_zvet" name="qwer" data-term-id="35" value="35" style="position: absolute; opacity: 0;">
<ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
</div>
<label class="woof_checkbox_label " for="woof_35_5ddabd90b4de9">Синий<span class="woof_checkbox_count">(0)</span>
</label>
<input type="hidden" value="Синий" data-anchor="woof_n_pa_zvet_blue">
</li>
<li class="woof_term_38 ">
<div class="icheckbox_flat-blue" style="position: relative;">
<input type="checkbox" id="woof_38_5ddabd90b541b" class="woof_checkbox_term woof_checkbox_term_38" data-tax="pa_zvet" name="zxcvv" data-term-id="38" value="38" style="position: absolute; opacity: 0;">
<ins class="iCheck-helper" style="position: absolute; top: 0%; left: 0%; display: block; width: 100%; height: 100%; margin: 0px; padding: 0px; background: rgb(255, 255, 255); border: 0px; opacity: 0;"></ins>
</div>
<label class="woof_checkbox_label " for="woof_38_5ddabd90b541b">Черный<span class="woof_checkbox_count">(4)</span>
</label>
<input type="hidden" value="Черный" data-anchor="woof_n_pa_zvet_black">
</li>
</ul>
</div>
<style>
.icheckbox_flat-blue {
width: 25px;
height: 25px;
}
</style>
或在这里 - https://jsfiddle.net/gkan10qr/20/ https://jsfiddle.net/gkan10qr/21/
我们有不同name=的,即 我们有几个name=
- 名称="qwer"
- 名称="asdf"
- 名称="zxcv"
需要女主角
<div class="icheckbox_flat-blue" >
根据嵌套的 INPUT 添加类以获取
<div class="icheckbox_flat-blue new-style" >
能够应用样式,例如
.icheckbox_flat-blue.new-style {
background: #F44336;
}
.icheckbox_flat-blue.asdf {
background: #F44336;
}
.icheckbox_flat-blue.qwer {
background: #333;
}
.icheckbox_flat-blue.zxcv {
background: #4CAF50;
}
1 个回答