Created
June 26, 2013 00:06
-
-
Save jnewman12/5863639 to your computer and use it in GitHub Desktop.
Makes the pretty boxes move when you click on them.
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:first-child').click(doInnerClick); | |
function doInnerClick(event) { | |
console.log('inner click'); | |
}*/ | |
$('.box').bind('click', function(event) { | |
$(this).animate({ | |
'borderRadius' : '50%' | |
}); | |
}); | |
}); | |
</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