Skip to content

Instantly share code, notes, and snippets.

@cybear
Created January 17, 2011 13:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cybear/782861 to your computer and use it in GitHub Desktop.
Save cybear/782861 to your computer and use it in GitHub Desktop.
CSS transition demo with snap back
<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