Created
January 17, 2011 13:54
-
-
Save cybear/782861 to your computer and use it in GitHub Desktop.
CSS transition demo with snap back
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
<html> | |
<head> | |
<style type="text/css"> | |
#graphline { | |
display:block; | |
width:10px; | |
height:200px; | |
background-color:#000; | |
} | |
#graphline { | |
-webkit-transition:all 500ms; | |
} | |
#graphline.full {width:500px;} | |
#graphline.back { | |
-webkit-transition:none; | |
} | |
</style> | |
</head> | |
<body> | |
<button onclick="document.getElementById('graphline').className='full';">Animate!</button> | |
<button onclick="document.getElementById('graphline').className='back';">Reset</button> | |
<div id="graphline"></div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment