1
I have the following code:
.switch-toggle {
float: left;
background: #242729;
}
.switch-toggle input {
position: absolute;
opacity: 0;
}
.switch-toggle input + label {
padding: 7px;
float:left;
color: #fff;
cursor: pointer;
}
.switch-toggle input:checked + label {
background: green;
}
<div class="switch-toggle switch-3 switch-candy">
<input id="on" name="state-d" type="radio" checked="" />
<label for="on" onclick="">ON</label>
<input id="na" name="state-d" type="radio" checked="checked" />
<label for="na" class="disabled" onclick="">N/A</label>
<input id="off" name="state-d" type="radio" />
<label for="off" onclick="">OFF</label>
</div>
This code makes a 3 status switch, where the user can select any of the options, however I need to disable the 3 switch options, preventing the user to click on them and change the status of the switch.
Since swicth was done in css, I’m not able to implement what I need, does anyone have any idea?
UPDATE
I ended up not giving so many details because I thought q would not be necessary, but the moment I should disable the options, should come from a click on a button, IE, when I click on a button, the switch should be disable in all options.
But why do you want to remove the function they were created for or when you want to disable them?
– LeAndrade
@Leandrade edited the question.
– Renan
And you don’t intend to empower them anymore?
– LeAndrade
@Thanks for your concern. In vdd I will have to enable after again, the button that will enable/disable will be true/false, this button is another switch only q is two options, the same issue is how to disable the switch being q was done in css, if you want to propose fully thank you
– Renan