0

i am using angular and my question is simple how can i make to rotate this icon when i click on it?:

<div class="col-lg-1 col-md-4 col-sm-2 col-2 alend-text">
        <i class="pomrgto iconfa fas fa-chevron-circle-right view_cir" title="Ver" aria-hidden="true" (click)="isCollapsed = !isCollapsed"
            [attr.aria-expanded]="!isCollapsed" aria-controls="collapseBasic"></i>
    </div>

the icon is the pomrgto iconfa fas fa-chevron-circle-right view_cir class, i want to do this:

enter image description here

When i click the icon, i want to make this rotate 90 degrees to the right making a little rotate animation, and when i click again go to the original state...

enter image description here

I know i can do it with css, but can you give me an idea of how can i do that?

Thank you!.

1 Answer 1

3

try something like this:

By default set transition property on the arrow. On click of the icon, add a new class to it (let say "active") then in CSS:

.pomrgto{
  transition: transform 1s;
 }

.active{
  transform: rotate(90deg)
}

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.