Created
June 26, 2013 00:00
-
-
Save jnewman12/5863608 to your computer and use it in GitHub Desktop.
Animates boxes. Made this in Last Week, forgot to upload.
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script> | |
<style> | |
.root { | |
background: grey; | |
padding: 40px; | |
} | |
.inner { | |
background: blue; | |
padding: 40px; | |
} | |
.box { | |
background: red; | |
padding: 40px; | |
margin: 10px 0; | |
} | |
</style> | |
<script> | |
$(document).ready(function() { | |
/* | |
$('body').click(function() { | |
console.log('body click'); | |
}); | |
}*/ | |
$('.inner').click(doInnerClick); | |
function doInnerClick(event) { | |
$(this).animate({ | |
'borderRadius' : '50%' | |
}); | |
} | |
$('.box').bind('click', function(event) { | |
$(this).animate({ | |
'borderRadius' : '50%' | |
}); | |
return false; | |
}); | |
}); | |
</script> | |
</head> | |
<body> | |
<div class="root"> | |
<div class="inner"> | |
<div class="box"></div> | |
<div class="box"></div> | |
<div class="box"></div> | |
</div> | |
<div class="inner"> | |
<div class="box"></div> | |
<div class="box"></div> | |
<div class="box"></div> | |
</div> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment