Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save APEMENdelights-PRVLUTION/974d69c566d1b0b7735a6e9084295b2d to your computer and use it in GitHub Desktop.
Save APEMENdelights-PRVLUTION/974d69c566d1b0b7735a6e9084295b2d to your computer and use it in GitHub Desktop.
Click and rotate awesome icon
<a href="#"><div class="fa fa-chevron-up rotate"></div></a>
$(".rotate").click(function () {
$(this).toggleClass("down");
})
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
.rotate {
-moz-transition: all .3s linear;
-webkit-transition: all .3s linear;
transition: all .3s linear;
}
.rotate.down {
-moz-transform:rotate(180deg);
-webkit-transform:rotate(180deg);
transform:rotate(180deg);
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment