public
Created

  • Download Gist
transitionExample.html
HTML
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
<!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>

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.