Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR CSS

rotate icon on click css

/*it would be easier to do this with CSS transitions:*/

/* CSS */
.rotate{
    -moz-transition: all 2s linear;
    -webkit-transition: all 2s linear;
    transition: all 2s linear;
}

.rotate.down{
    -ms-transform: rotate(180deg);
    -moz-transform: rotate(180deg);
    -webkit-transform: rotate(180deg);
    transform: rotate(180deg);
}

/*jQuery*/

$(".rotate").click(function(){
    $(this).toggleClass("down"); 
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #rotate #icon #click #css
ADD COMMENT
Topic
Name
3+2 =