A Pen by Armando Prieto on CodePen.
Created
September 6, 2018 10:17
-
-
Save ArmandoPrieto/e3018417c31c36308802158ff185c831 to your computer and use it in GitHub Desktop.
CSS Transition
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
<html> | |
<body> | |
<div class="box"> | |
<div class="innerbox"> | |
</div> | |
</div> | |
</body> | |
</html> | |
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
/*$(".box").hover(function() { | |
$('.innerbox').addClass("movement"); | |
}); | |
*/ |
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
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> |
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
.box | |
width: 150px | |
height: 150px | |
border: 20px solid #999 | |
background: #ddd | |
.innerbox | |
display: inline-block | |
background: pink | |
width: 150px | |
height: 150px | |
transition: transform 300ms ease-in-out | |
pointer-events: none | |
.box:hover .innerbox | |
transform: translate(200px,150px) rotate(20deg) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment