让 Foundation 6 拨动开关一直移动?
Make Foundation 6 toggle switch move all the way over?
在 https://jsfiddle.net/L4a8cbqw/ 处的 fiddle 中有一个拨动开关。单击时,白框不会一直向右滑动,它会在中途停止。这是因为我调整了开关的大小。无论拨动开关有多宽,如何让白框一直滑到右边?
<div class="switch large">
<input class="switch-input" id="largeSwitch" type="checkbox" name="exampleSwitch">
<label class="switch-paddle" for="largeSwitch" style="width: 7rem !important; font-weight: bold;">
<span class="show-for-sr">Show Large Elephants</span>
<span class="switch-active" aria-hidden="true">Off</span>
<span class="switch-inactive" aria-hidden="true">Show</span>
</label>
</div>
这个CSS应该做到:
.switch.large input:checked ~ .switch-paddle:after {
left: 4.75rem;
}
在 https://jsfiddle.net/L4a8cbqw/ 处的 fiddle 中有一个拨动开关。单击时,白框不会一直向右滑动,它会在中途停止。这是因为我调整了开关的大小。无论拨动开关有多宽,如何让白框一直滑到右边?
<div class="switch large">
<input class="switch-input" id="largeSwitch" type="checkbox" name="exampleSwitch">
<label class="switch-paddle" for="largeSwitch" style="width: 7rem !important; font-weight: bold;">
<span class="show-for-sr">Show Large Elephants</span>
<span class="switch-active" aria-hidden="true">Off</span>
<span class="switch-inactive" aria-hidden="true">Show</span>
</label>
</div>
这个CSS应该做到:
.switch.large input:checked ~ .switch-paddle:after {
left: 4.75rem;
}