Skip to content

Instantly share code, notes, and snippets.

@ynonp
Created August 19, 2012 13:24
Show Gist options
  • Save ynonp/3394768 to your computer and use it in GitHub Desktop.
Save ynonp/3394768 to your computer and use it in GitHub Desktop.
transition.html
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Wow CSS3</title>
<script src="http://code.jquery.com/jquery-1.8.0.min.js"></script>
<meta name="viewport" content="initial-scale=1,user-scalable=0,maximum-scale=1,minimum-scale=1" />
<style>
div.right {
width:200px;
height:200px;
background: purple;
-webkit-transition: 0.5s all;
float:left;
}
div.left {
width:0px;
height:200px;
float:left;
background: blue;
-webkit-transition: 0.5s all;
}
</style>
</head>
<body>
<div class="right"></div>
<div class="left"></div>
<script>
$('div.right').click(function() {
$('div.right').css('width', '100px');
$('div.left').css('width', '100px');
});
$('div.left').click(function() {
$('div.right').css('width', '200px');
$('div.left').css('width', '0px');
})
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment