0
I have an element that I want to turn it as I click on it, this element is a Collapse:
<td><a class="fa fa-chevron-down iconedetalhes" data-toggle="collapse" href="#collapse{{i}}" aria-expanded="false" aria-hidden="true"></a>
<p class="collapse" id="collapse{{i}}">
teste
</p>
My class:
.iconedetalhes:focus{
-webkit-transform: rotate(180deg);
-ms-transform: rotate(180deg);
transform: rotate(180deg);
transition-duration: 0.7s!important;
}
But this way I have two problems:
The first is that after I click on the element it turns, but then it doesn’t scroll when I click again.
This may be because you are doing an "add class" when actually it should be a "toggle class" if it is with JS... If you go with CSS you need to use a hidden checkbox to swap the brother class when checked or uncheckd.... I don’t quite understand the :Focus because as soon as you take out the focus by clicking anywhere else it takes the class ...
– hugocsl
I tried but when I click on the label it does not check the combobox. only when I click on the check it turns into the content: <input type="checkbox" id="Hacky-input"> <label for="Hacky-input"> <a class="fa fa-chevron-down iconandcrossRotate" data-toggle="Collapse" href="#Collapse{i}}" Aria-Expanded="false" Aria-Hidden="true"></a> </label> <p class="Collapse" id="Collapse{{i}}"> test </p>
– veroneseComS
Give one studied in this example. By its CSS and by the structure of its HTML things are pretty weird rss. Look at an example here: https://codepen.io/origamid/pen/oeYQpK if you still have doubts, tell me that I set an even simpler example for you with the details of how to assemble this type of "component" ok
– hugocsl