Skip to content

Instantly share code, notes, and snippets.

@bcardarella
Created February 18, 2012 22:08
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 bcardarella/1861131 to your computer and use it in GitHub Desktop.
Save bcardarella/1861131 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<title>My App</title>
<script src="jquery.min.js"></script>
<style>
div {
position: absolute;
width: 50px;
height: 50px;
top: 100px;
left: 100px;
background: gray;
-webkit-transition: top 1s ease, left 1s ease, background 1s ease 1s;
}
div.state_1 {
top: 400px;
left: 600px;
background: black;
}
</style>
<script>
$(function() {
$('#box').click(function() {
$(this).toggleClass('state_1');
});
});
</script>
</head>
<body>
<div id="box"></div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment