Created
October 25, 2012 19:26
-
-
Save williammoreschi/3954853 to your computer and use it in GitHub Desktop.
A CodePen by maciekmp. CSS Heart with js animation - CSS Heart with js animation
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
<div class='left'> | |
<div style='padding-right:68px'> | |
<div></div> | |
<div></div> | |
</div> | |
<div style='padding-right:34px'> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
</div> | |
</div> | |
<div class='right'> | |
<div style='padding-left:34px'> | |
<div></div> | |
<div></div> | |
</div> | |
<div style=''> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
<div></div> | |
</div> | |
<div> | |
<div></div> | |
</div> | |
</div> |
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
$(document).ready(function(){ | |
$('div>div>div').each(function(id){ | |
$(this).css({ | |
position: 'relative', | |
top: '-200px', | |
opacity: 0 | |
}); | |
var wait = Math.floor((Math.random()*3000)+1); | |
$(this).delay(wait).animate({ | |
top: '0px', | |
opacity: 1 | |
},1000); | |
}) | |
}); |
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
body{ | |
margin:80px | |
} | |
.left,.right{ | |
display:inline-block | |
} | |
.left{ | |
width:170px; | |
height:239px; | |
margin-right:-4px | |
} | |
div>div{ | |
display:block; | |
height:34px; | |
} | |
div>div>div{ | |
width:30px; | |
height:30px; | |
background-color:red; | |
display:inline-block; | |
float:right; | |
margin:2px; | |
} | |
div.right>div>div{ | |
float:left; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment