rotate icon on click css

Solutions on MaxInterview for rotate icon on click css by the best coders in the world

showing results for - "rotate icon on click css"
Lucas
14 Jan 2019
1/*it would be easier to do this with CSS transitions:*/
2
3/* CSS */
4.rotate{
5    -moz-transition: all 2s linear;
6    -webkit-transition: all 2s linear;
7    transition: all 2s linear;
8}
9
10.rotate.down{
11    -ms-transform: rotate(180deg);
12    -moz-transform: rotate(180deg);
13    -webkit-transform: rotate(180deg);
14    transform: rotate(180deg);
15}
16
17/*jQuery*/
18
19$(".rotate").click(function(){
20    $(this).toggleClass("down"); 
21});