A Pen by Charlie Chrisman on CodePen.
Created
July 7, 2015 23:00
-
-
Save cachrisman/99135714161a182d822a to your computer and use it in GitHub Desktop.
Animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="stage"> | |
<div class="test">Click me to see the magic happen</div> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
$(".test").click(function() { | |
$(".test").toggleClass("test-click"); | |
}); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@keyframes change_colors { | |
25% { | |
background-color: red; | |
} | |
50% { | |
background-color: blue; | |
} | |
75% { | |
background-color: yellow; | |
} | |
100% { | |
background-color: red; | |
} | |
} | |
.stage { | |
padding: 50px; | |
background: #eaeaed; | |
height: 100px; | |
} | |
.test { | |
margin: auto; | |
background: red; | |
height: 100px; | |
width: 150px; | |
} | |
.test-click { | |
animation: change_colors 4s ease 0s infinite; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment